summaryrefslogtreecommitdiffstats
path: root/core/views/expo.py
diff options
context:
space:
mode:
Diffstat (limited to 'core/views/expo.py')
-rw-r--r--core/views/expo.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/views/expo.py b/core/views/expo.py
index 2d617b8..723f772 100644
--- a/core/views/expo.py
+++ b/core/views/expo.py
@@ -14,7 +14,7 @@ import troggle.core.views.caves
import troggle.settings as settings
from troggle.core.models.caves import Cave
from troggle.core.utils import (
- COOKIE_MAX_AGE,
+ get_cookie_max_age,
WriteAndCommitError,
current_expo,
git_string,
@@ -493,8 +493,8 @@ def editexpopage(request, path):
if not filefound or result != html: # Check if content changed at all
edit_response = HttpResponseRedirect(reverse("expopage", args=[path])) # Redirect after POST
- edit_response.set_cookie('editor_id', editor, max_age=COOKIE_MAX_AGE) # cookie expires after COOKIE_MAX_AGE seconds
- print(f"Cookie set: {editor} for {COOKIE_MAX_AGE/(24*3600)} days")
+ edit_response.set_cookie('editor_id', editor, max_age=get_cookie_max_age()) # cookie expires after get_cookie_max_age() seconds
+ print(f"Cookie set: {editor} for {get_cookie_max_age()/(3600)} hour(s)")
try:
change_message = pageform.cleaned_data["change_message"]
write_and_commit([(filepath, result, "utf-8")], f"{change_message} - online edit of {path}", editor)
@@ -610,7 +610,7 @@ def edittxtpage(request, path, filepath):
savepath = "/" + path
print(f"redirect {savepath}")
response = redirect(savepath) # Redirect after POST
- 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
else: