mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-18 22:27:08 +00:00
refactoring cookie age as a function not a constant
This commit is contained in:
@@ -16,7 +16,8 @@ from django.conf import settings as django_settings
|
||||
from PIL import Image
|
||||
|
||||
import troggle.settings as settings
|
||||
from troggle.core.utils import ( COOKIE_MAX_AGE,
|
||||
from troggle.core.utils import (
|
||||
get_cookie_max_age,
|
||||
WriteAndCommitError, get_editor,
|
||||
git_string,
|
||||
write_binary_file, write_and_commit, write_files,
|
||||
@@ -409,7 +410,7 @@ def new_image_form(request, path):
|
||||
)
|
||||
save_original_in_expofiles(f, year, form.cleaned_data["photographer"], host, image_rel_path, referer)
|
||||
j_response = JsonResponse({"html": html_snippet})
|
||||
j_response.set_cookie('editor_id', editor, max_age=COOKIE_MAX_AGE) # does NOT seem to work updating who_are_you cookie
|
||||
j_response.set_cookie('editor_id', editor, max_age=get_cookie_max_age()) # does NOT work updating who_are_you cookie - because it is JsonResponse not HttpResponse.
|
||||
return j_response
|
||||
else:
|
||||
# print(f"new_image_form(): not POST ")
|
||||
|
||||
Reference in New Issue
Block a user