From d3319895c7eea99811d09d19527f607ceae08f7b Mon Sep 17 00:00:00 2001 From: j Date: Sat, 15 Feb 2025 00:57:34 +0100 Subject: [PATCH] time fixes --- app/item/models.py | 2 +- app/item/views.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/item/models.py b/app/item/models.py index ec9f6fd..a77cc86 100644 --- a/app/item/models.py +++ b/app/item/models.py @@ -316,7 +316,7 @@ class Week(models.Model): if self.use_hue: colors = [] for item in self.items(): - if now and item.published > now: + if now and item.published >= now: continue color = item.get_hue(update=True) if color: diff --git a/app/item/views.py b/app/item/views.py index 19743ab..1fced1d 100644 --- a/app/item/views.py +++ b/app/item/views.py @@ -64,14 +64,12 @@ def index(request): if request.user.is_staff and now: now = datetime.strptime(now, TS_FORMAT) now = timezone.make_aware(now, timezone.get_default_timezone()) - elif request.user.is_staff: - now = get_now() else: - now = None + now = get_now() monday = get_monday(now) week, archive = models.Item.public(now) 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: context["break"] = week else: