if last week is break it exteds until we have content
This commit is contained in:
parent
c0a4b778b1
commit
270200cac3
1 changed files with 3 additions and 0 deletions
|
|
@ -83,6 +83,9 @@ class Item(models.Model):
|
||||||
elif not first_post:
|
elif not first_post:
|
||||||
while qs.exists() and not first_post:
|
while qs.exists() and not first_post:
|
||||||
monday = monday - timedelta(days=7)
|
monday = monday - timedelta(days=7)
|
||||||
|
current_week = Week.objects.filter(monday=monday).first()
|
||||||
|
if current_week and current_week.is_break:
|
||||||
|
return current_week, qs
|
||||||
first_post = qs.filter(published__gt=monday).first()
|
first_post = qs.filter(published__gt=monday).first()
|
||||||
week = qs.filter(published__gt=monday)
|
week = qs.filter(published__gt=monday)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue