diff --git a/CHANGELOG.md b/CHANGELOG.md index ad10eb9a..7c5c17ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,9 @@ Versioning](https://semver.org/spec/v2.0.0.html). - add django rest framework to promote/revoke moderators for current LTIContext - add new role moderator and permission to manage moderators +### Fixed + - fix sorting on sticky and announcements topics + ## [1.0.0-beta.5] - 2020-03-01 ### Changed diff --git a/src/ashley/machina_extensions/forum/views.py b/src/ashley/machina_extensions/forum/views.py index b5a633e1..2a46e8c1 100644 --- a/src/ashley/machina_extensions/forum/views.py +++ b/src/ashley/machina_extensions/forum/views.py @@ -72,7 +72,8 @@ def get_ordering(self): def get_queryset(self): """Returns the list of items for this view ordered by asked param.""" query = super().get_queryset() - return query.order_by(self.get_ordering_column()) + # Type of topic is kept as first order argument to keep sticky option + return query.order_by("-type", self.get_ordering_column()) def get_context_data(self, **kwargs): """Returns the context data to provide to the template.""" diff --git a/src/ashley/templates/forum_conversation/topic_list.html b/src/ashley/templates/forum_conversation/topic_list.html index 77b545e5..3fa2516f 100644 --- a/src/ashley/templates/forum_conversation/topic_list.html +++ b/src/ashley/templates/forum_conversation/topic_list.html @@ -9,23 +9,39 @@