From e2d7ab441693ee77a35d2df9f8b85d004c669a6b Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Fri, 15 Mar 2024 12:49:01 +0000 Subject: [PATCH] detect missing current expo on expo page --- core/utils.py | 2 +- core/views/logbooks.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/utils.py b/core/utils.py index e5d2726..e4fda48 100644 --- a/core/utils.py +++ b/core/utils.py @@ -91,7 +91,7 @@ def alphabet_suffix(n): def make_new_expo(year): coUniqueAttribs = {"year": year} - otherAttribs = {"name": f"CUCC expo {year}"} + otherAttribs = {"name": f"CUCC expo {year}", "logbookfile": "logbook.html"} e = Expedition.objects.create(**otherAttribs, **coUniqueAttribs) u = User.objects.get(username='expo') u.current_year = year diff --git a/core/views/logbooks.py b/core/views/logbooks.py index 4579e6e..da0468e 100644 --- a/core/views/logbooks.py +++ b/core/views/logbooks.py @@ -66,6 +66,7 @@ def expedition(request, expeditionname): does lazy evaluation. """ + current = current_expo() # creates new expo after 31st Dec. try: expo = Expedition.objects.get(year=int(expeditionname)) except: