Fix bug with pagination around year-boundries

This commit is contained in:
Matthias Portzel 2021-12-31 21:17:15 -08:00
parent 48496ec839
commit bd3094e221
1 changed files with 6 additions and 3 deletions

View File

@ -79,9 +79,12 @@ def season_pages():
first_thought = ordered_thoughts.first()
last_thought = ordered_thoughts.last()
current_year = first_thought.posted.year
current_season = season_for_date(first_thought.posted)
while current_year < last_thought.posted.year or current_season != season_for_date(last_thought.posted):
current_season, current_year = season_year_for_date(first_thought.posted)
last_season, last_year = season_year_for_date(last_thought.posted)
while current_year < last_year or current_season != last_season:
print(current_season, current_year)
yield SeasonPage(current_season, current_year)
if current_season == 0: