Skip to content

Commit

Permalink
Ensure view gets a locale (#6503)
Browse files Browse the repository at this point in the history
* Ensure view gets a locale
  • Loading branch information
smithellis authored Feb 12, 2025
1 parent 4dd0904 commit 0d4b981
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kitsune/wiki/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1697,10 +1697,10 @@ def recent_revisions(request):
form.is_valid()

filters = {}

if hasattr(form, "cleaned_data"):
if form.cleaned_data.get("locale"):
filters.update(document__locale=form.cleaned_data["locale"])

# Only apply user filter if there are valid users
if form.cleaned_data.get("users"):
filters.update(creator__in=form.cleaned_data["users"])
Expand All @@ -1717,7 +1717,7 @@ def recent_revisions(request):
c = {
"revisions": revs,
"form": form,
"locale": request.GET.get("locale", request.LANGUAGE_CODE),
"locale": request.GET.get("locale") or request.LANGUAGE_CODE,
}
if fragment:
template = "wiki/includes/recent_revisions_fragment.html"
Expand Down

0 comments on commit 0d4b981

Please sign in to comment.