Skip to content

Commit

Permalink
Merge pull request #277 from datamade/hcg/person-rss
Browse files Browse the repository at this point in the history
Add timezone to bill sponsorship sort callback, connects #259
  • Loading branch information
hancush authored May 20, 2021
2 parents 66e95ba + d4b3ecd commit 5b074f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion councilmatic_core/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import datetime
import os
import pytz

from django.db import models
from django.contrib.gis.db import models as geo_models
Expand Down Expand Up @@ -98,7 +99,7 @@ def sponsorship_sort(sponsorship):
'''
Sponsorships of bills without recent action dates should appear last.
'''
return sponsorship.bill.last_action_date or datetime.date(datetime.MINYEAR, 1, 1)
return sponsorship.bill.last_action_date or pytz.utc.localize(datetime.date(datetime.MINYEAR, 1, 1))

return sorted((s for s in primary_sponsorships), key=sponsorship_sort, reverse=True)

Expand Down

0 comments on commit 5b074f3

Please sign in to comment.