Skip to content

Commit

Permalink
Fix chartdata - look only until end of competition
Browse files Browse the repository at this point in the history
  • Loading branch information
obscurerichard committed Nov 23, 2024
1 parent c8e9ec5 commit 42ba7fe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion freezing/web/views/chartdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,12 @@ def user_daily_points(athlete_id):
# This is a really inefficient way to do this, but it's also super simple. And I'm feeling lazy :)
start_date = config.START_DATE
start_date = start_date.replace(tzinfo=None)
day_r = rrule.rrule(rrule.DAILY, dtstart=start_date, until=datetime.now())
# only look until the end of the competition though
end_date = config.END_DATE
end_date = end_date.replace(tzinfo=None)
day_r = rrule.rrule(
rrule.DAILY, dtstart=start_date, until=min(datetime.now(), end_date)
)
rows = []
for i, dt in enumerate(day_r):
# Thanks Stack Overflow https://stackoverflow.com/a/25265611/424301
Expand Down

0 comments on commit 42ba7fe

Please sign in to comment.