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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user