summaryrefslogtreecommitdiffstats
path: root/core/views/other.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2025-06-25 23:30:20 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2025-06-25 23:30:20 +0300
commita7966e714de7ed3aae5dd25c578344c934dd8572 (patch)
treece5edfac97c6a490dd80753a4c67847a74ea7be7 /core/views/other.py
parent19844cd94a4a7c798921a2858f038eb9a2db99a5 (diff)
downloadtroggle-a7966e714de7ed3aae5dd25c578344c934dd8572.tar.gz
troggle-a7966e714de7ed3aae5dd25c578344c934dd8572.tar.bz2
troggle-a7966e714de7ed3aae5dd25c578344c934dd8572.zip
shared use machine short-cookie timeout implemented for survex file editing only
Diffstat (limited to 'core/views/other.py')
-rw-r--r--core/views/other.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/views/other.py b/core/views/other.py
index fd1d1ef..ceec79f 100644
--- a/core/views/other.py
+++ b/core/views/other.py
@@ -11,7 +11,7 @@ from troggle.core.models.logbooks import LogbookEntry, writelogbook # , PersonL
# from databaseReset import reinit_db # don't do this. databaseRest runs code *at import time*
from troggle.core.models.troggle import Expedition
-from troggle.core.utils import current_expo, COOKIE_SHORT_TIMEOUT
+from troggle.core.utils import current_expo, COOKIE_SHORT_TIMEOUT, PUBLIC_LAPTOP_COOKIE_NAME, PUBLIC_LAPTOP_COOKIE_TEXT
from troggle.parsers.imports import (
import_caves,
import_drawingsfiles,
@@ -42,7 +42,7 @@ def public_laptop(request):
This hack to be replaced in due course by a proper call from a user saying whether they are using a shared machine or not.
"""
response = HttpResponse(f"Cookie has been set on this machine, which now defines it as a public laptop. So the login cookie lifetimes will now be short:{COOKIE_SHORT_TIMEOUT/(60*60)} hour(s)")
- response.set_cookie("public_laptop", "this is a public laptop", max_age=COOKIE_SHORT_TIMEOUT) # Cookie expires in 1 hour
+ response.set_cookie(PUBLIC_LAPTOP_COOKIE_NAME, PUBLIC_LAPTOP_COOKIE_TEXT, max_age=COOKIE_SHORT_TIMEOUT) # Cookie expires in 1 hour
return response
def todos(request, module):