Skip to content

Commit

Permalink
Don't move order by
Browse files Browse the repository at this point in the history
  • Loading branch information
msj committed Jun 14, 2024
1 parent 1b52e76 commit 9e73f23
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lametro/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,20 +418,17 @@ def committee_sponsorships(self):
Organizations do not include the Board of Directors.
"""
actions = (
BillAction.objects.select_related("organization")
.filter(
organization__classification="committee",
organization__memberships__in=Subquery(
self.current_memberships.values("pk")
),
)
.order_by("-date")
actions = BillAction.objects.select_related("organization").filter(
organization__classification="committee",
organization__memberships__in=Subquery(
self.current_memberships.values("pk")
),
)

qs = (
LAMetroBill.objects.defer("extras")
.filter(actions__in=Subquery(actions.values("pk")))
.order_by("-actions__date")
.distinct()[:5]
)

Expand Down

0 comments on commit 9e73f23

Please sign in to comment.