From b884d7c4a1469dc8b771013dbd270d8e053b7cee Mon Sep 17 00:00:00 2001
From: Anders Bruun Severinsen <202204885@post.au.dk>
Date: Sat, 4 Jan 2025 23:20:17 +0100
Subject: [PATCH] Refactor navigation links in base template and update
bartender shift query for improved accuracy
---
web/templates/base.html | 3 ---
web/views.py | 6 +++---
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/web/templates/base.html b/web/templates/base.html
index bbeb27f..6e70f64 100644
--- a/web/templates/base.html
+++ b/web/templates/base.html
@@ -75,7 +75,6 @@
{% translate "Barplan" %}
{% translate "Bartendere" %}
{% translate "Sortiment" %}
-
{% translate "Udlejning" %}
-
{% translate "Guides" %}
{% translate "Bestyrelsen" %}
{% translate "Events" %}
{% translate "Gallery" %}
- {% translate "Sortiment" %}
{% translate "Om baren" %}
{% translate "Profil" %}
diff --git a/web/views.py b/web/views.py
index 3f30749..92bd4e4 100644
--- a/web/views.py
+++ b/web/views.py
@@ -63,9 +63,9 @@ def get_context_data(self, **kwargs):
bartender_shifts = BartenderShift.objects.defer(
"responsible", "other_bartenders", "period"
)
- shifts = bartender_shifts.filter(end_datetime__lte=timezone.now())
- current_shift = shifts.filter(
- start_datetime__gte=timezone.now() - datetime.timedelta(days=7),
+ current_shift = bartender_shifts.filter(
+ start_datetime__lte=timezone.now(),
+ end_datetime__gte=timezone.now() - datetime.timedelta(days=7),
)
shift_streak = 0
start_date = timezone.now()