2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-08 16:28:06 +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

@@ -20,7 +20,7 @@ from troggle.core.models.survex import SurvexBlock, SurvexFile, SurvexPersonRole
from troggle.core.models.troggle import DataIssue, Expedition
from troggle.core.models.wallets import YEAR_RANGE, Wallet, make_valid_date
from troggle.core.utils import (
COOKIE_MAX_AGE,
get_cookie_max_age,
WriteAndCommitError,
add_commit,
current_expo,
@@ -978,6 +978,6 @@ def walletedit(request, path=None):
"freetextsize": str(max(60, len(str(freetext)))),
},
)
edit_response.set_cookie('editor_id', editor, max_age=COOKIE_MAX_AGE) # cookie expires after COOKIE_MAX_AGE seconds
edit_response.set_cookie('editor_id', editor, max_age=get_cookie_max_age()) # cookie expires after get_cookie_max_age() seconds
return edit_response