Skip to content

Commit

Permalink
fixes sublegislation ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
actlikewill committed Aug 28, 2024
1 parent 4b153a7 commit 029f032
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions liiweb/views/legislation.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class LegislationListView(FilteredDocumentListView):

def get_form(self):
self.form_defaults = {"sort": "title"}
if self.variant == "recent":
if self.variant in ["recent", "subleg"]:
self.form_defaults = {"sort": "-date"}
return super().get_form()

Expand Down Expand Up @@ -89,7 +89,7 @@ def add_children(self, queryset):
children = defaultdict(list)
children_qs = Legislation.objects.filter(
parent_work_id__in=parents, repealed=False, metadata_json__principal=True
)
).order_by("-date")
children_qs = children_qs.preferred_language(get_language(self.request))
# group children by parent
for child in children_qs:
Expand Down

0 comments on commit 029f032

Please sign in to comment.