time fixes
This commit is contained in:
parent
f02023b079
commit
d3319895c7
2 changed files with 3 additions and 5 deletions
|
|
@ -316,7 +316,7 @@ class Week(models.Model):
|
||||||
if self.use_hue:
|
if self.use_hue:
|
||||||
colors = []
|
colors = []
|
||||||
for item in self.items():
|
for item in self.items():
|
||||||
if now and item.published > now:
|
if now and item.published >= now:
|
||||||
continue
|
continue
|
||||||
color = item.get_hue(update=True)
|
color = item.get_hue(update=True)
|
||||||
if color:
|
if color:
|
||||||
|
|
|
||||||
|
|
@ -64,14 +64,12 @@ def index(request):
|
||||||
if request.user.is_staff and now:
|
if request.user.is_staff and now:
|
||||||
now = datetime.strptime(now, TS_FORMAT)
|
now = datetime.strptime(now, TS_FORMAT)
|
||||||
now = timezone.make_aware(now, timezone.get_default_timezone())
|
now = timezone.make_aware(now, timezone.get_default_timezone())
|
||||||
elif request.user.is_staff:
|
|
||||||
now = get_now()
|
|
||||||
else:
|
else:
|
||||||
now = None
|
now = get_now()
|
||||||
monday = get_monday(now)
|
monday = get_monday(now)
|
||||||
week, archive = models.Item.public(now)
|
week, archive = models.Item.public(now)
|
||||||
if archive and archive.exists():
|
if archive and archive.exists():
|
||||||
context['archive'] = '/_%s/' % get_monday(get_now() - timedelta(days=7))
|
context['archive'] = '/_%s/' % get_monday(now - timedelta(days=7))
|
||||||
if isinstance(week, models.Week) and week.is_break:
|
if isinstance(week, models.Week) and week.is_break:
|
||||||
context["break"] = week
|
context["break"] = week
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue