summaryrefslogtreecommitdiffstats
path: root/core/views/logbook_edit.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2025-06-14 20:36:31 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2025-06-14 20:36:31 +0300
commit40fb066e2be579f07e8219bfa2306d66278b4b00 (patch)
tree992f58f2ac0d1fe8cf2c5888d1a957f2272bc2ee /core/views/logbook_edit.py
parentd8cdf7bc5ac1d258b36a8548c354e82ca314197a (diff)
downloadtroggle-40fb066e2be579f07e8219bfa2306d66278b4b00.tar.gz
troggle-40fb066e2be579f07e8219bfa2306d66278b4b00.tar.bz2
troggle-40fb066e2be579f07e8219bfa2306d66278b4b00.zip
refactoring cookie age as a function not a constant
Diffstat (limited to 'core/views/logbook_edit.py')
-rw-r--r--core/views/logbook_edit.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/views/logbook_edit.py b/core/views/logbook_edit.py
index 7207842..7a79528 100644
--- a/core/views/logbook_edit.py
+++ b/core/views/logbook_edit.py
@@ -13,7 +13,7 @@ from troggle.core.models.logbooks import LogbookEntry, PersonLogEntry, writelogb
from troggle.core.models.survex import DrawingFile
from troggle.core.models.troggle import DataIssue, Expedition, PersonExpedition
from troggle.core.utils import (
- COOKIE_MAX_AGE,
+ get_cookie_max_age,
add_commit,
alphabet_suffix,
current_expo,
@@ -344,7 +344,7 @@ def logbookedit(request, year=None, slug=None):
# error settings e.g dateflag and authroflag so the user gets no feedback about bad data entered.
# so we need to pass the flags explicitly in the url and then extract them from the request in the GET bit. sigh.
response = HttpResponseRedirect(f"/logbookedit/{slug}?dateflag={dateflag}&authorflag={authorflag}")
- response.set_cookie('editor_id', editor, max_age=COOKIE_MAX_AGE) # cookie expires after COOKIE_MAX_AGE seconds
+ response.set_cookie('editor_id', editor, max_age=get_cookie_max_age()) # cookie expires after get_cookie_max_age() seconds
return response
# Do the redirect instead of this: