2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-18 05:57:11 +00:00

refactoring cookie age as a function not a constant

This commit is contained in:
2025-06-14 20:36:31 +03:00
parent d8cdf7bc5a
commit 40fb066e2b
11 changed files with 30 additions and 23 deletions

View File

@@ -18,7 +18,7 @@ from troggle.core.models.logbooks import LogbookEntry
from troggle.core.models.survex import SurvexBlock, SurvexFile #, SurvexDirectory
from troggle.core.models.wallets import Wallet
from troggle.core.utils import (
COOKIE_MAX_AGE,
get_cookie_max_age,
add_commit,
current_expo,
get_editor,
@@ -441,8 +441,8 @@ def svx(request, survex_file):
else:
edit_response = render(request, "svxfile.html", vmap)
edit_response.set_cookie('editor_id', editor, max_age=COOKIE_MAX_AGE) # cookie expires after COOKIE_MAX_AGE seconds
print(f"Cookie reset: {editor} for another {COOKIE_MAX_AGE/3600} hours")
edit_response.set_cookie('editor_id', editor, max_age=get_cookie_max_age()) # cookie expires after get_cookie_max_age() seconds
print(f"Cookie reset: {editor} for another {get_cookie_max_age()/3600} hour(s)")
return edit_response