From dfdf21459a08664956cd7c05d8d0f69ae4ff872b Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Wed, 10 Apr 2024 23:25:13 +0100 Subject: fix current year in top menu --- core/views/logbooks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/views/logbooks.py') diff --git a/core/views/logbooks.py b/core/views/logbooks.py index da0468e..838595a 100644 --- a/core/views/logbooks.py +++ b/core/views/logbooks.py @@ -159,7 +159,8 @@ def person(request, slug=""): """Now very much simpler with an unambiguous slug """ this_person = Person.objects.get(slug=slug) - return render(request, "person.html", {"person": this_person}) + current_year = current_expo() + return render(request, "person.html", {"person": this_person, "year": current_year}) def get_person_chronology(personexpedition): """ @@ -201,9 +202,10 @@ def personexpedition(request, slug="", year=""): this_expedition = Expedition.objects.get(year=year) personexpedition = person.personexpedition_set.get(expedition=this_expedition) personchronology = get_person_chronology(personexpedition) + current_year = current_expo() return render( - request, "personexpedition.html", {"personexpedition": personexpedition, "personchronology": personchronology} + request, "personexpedition.html", {"personexpedition": personexpedition, "personchronology": personchronology, "year": current_year} ) except: msg = f" Person '{slug=}' or year '{year=}' not found in database. Please report this to a nerd." -- cgit v1.2.3