Fix bug with pagination around year-boundries
This commit is contained in:
parent
48496ec839
commit
bd3094e221
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue