Skip to content

Commit

Permalink
Fix sorting article discussion posts by Author, Replies or Last Post (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
gghati authored Nov 2, 2020
1 parent d741a34 commit 97678f8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions kitsune/kbforums/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,20 +433,17 @@ def locale_discussions(request):
document__locale=request.LANGUAGE_CODE, document__allow_discussion=True
)
try:
sort = int(request.GET.get("sort", 0))
sort = int(request.GET.get("sort", 5))
except ValueError:
sort = 0
sort = 5

try:
desc = int(request.GET.get("desc", 0))
desc = int(request.GET.get("desc", 1))
except ValueError:
desc = 0
desc = 1
desc_toggle = 0 if desc else 1

threads_ = sort_threads(threads, sort, desc)

# Ignore sticky-ness:
threads_ = threads_.order_by("-last_post__created")
threads_ = paginate(request, threads_, per_page=kbforums.THREADS_PER_PAGE)
is_watching_locale = request.user.is_authenticated and NewThreadInLocaleEvent.is_notifying(
request.user, locale=request.LANGUAGE_CODE
Expand Down

0 comments on commit 97678f8

Please sign in to comment.