summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/utils.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/core/utils.py b/core/utils.py
index 50330f1..23d6a85 100644
--- a/core/utils.py
+++ b/core/utils.py
@@ -205,10 +205,18 @@ def parse_aliases(aliasfile):
return aliases, report
def get_cookie(request):
- NO_COOKIE_DEFAULT = 'Unset Cookie <hohlenforscher@potatohut.expo>'
+ """The initial idea of having a default turned out to be a bad idea as people just ignore the field.
+ if the default value is blank, then the form validation code makes the user type something in,
+ so having a blank is best.
+ """
+ # NO_COOKIE_DEFAULT = 'Unset Cookie <hohlenforscher@potatohut.expo>'
print(f"-- Getting cookie...")
- editor_id = request.COOKIES.get('editor_id', NO_COOKIE_DEFAULT) # if no cookie, then default string
- editor = git_string(editor_id) # belt and braces, should have been validity checked on saving already
+ editor_id = request.COOKIES.get('editor_id', "") # if no cookie, then default string ""
+ if editor_id.startswith("Unset"):
+ # clean out laziness in users' PCs
+ editor_id = ""
+ else:
+ editor = git_string(editor_id) # belt and braces, should have been validity checked on saving already
print(f"-- Cookie to be used: {editor=}")
return editor