summaryrefslogtreecommitdiffstats
path: root/core/views/survex.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2024-12-28 22:43:21 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2024-12-28 22:43:21 +0000
commite7444d20a4759cc3b1a9232c5129499ba5e1abfc (patch)
tree5974caee3e4609609d87f82d9751815bdb80b863 /core/views/survex.py
parentecd187e88eb4da7a15a949e46f202605928993ce (diff)
downloadtroggle-e7444d20a4759cc3b1a9232c5129499ba5e1abfc.tar.gz
troggle-e7444d20a4759cc3b1a9232c5129499ba5e1abfc.tar.bz2
troggle-e7444d20a4759cc3b1a9232c5129499ba5e1abfc.zip
cave edit working with cookies
Diffstat (limited to 'core/views/survex.py')
-rw-r--r--core/views/survex.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/core/views/survex.py b/core/views/survex.py
index c909a40..afa6a69 100644
--- a/core/views/survex.py
+++ b/core/views/survex.py
@@ -19,7 +19,7 @@ from troggle.core.models.caves import Cave, GetCaveLookup
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, current_expo, git_string, add_commit
+from troggle.core.utils import COOKIE_MAX_AGE, current_expo, get_cookie, git_string, add_commit
from troggle.parsers.survex import parse_one_file
"""Everything that views survexfiles
@@ -313,10 +313,7 @@ def svx(request, survex_file):
nowtime = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
outputtype = "normal"
- print(f"Reading cookie...")
- editor_id = request.COOKIES.get('editor_id', 'speleologist') # if no cookie, then default string
- editor = git_string(editor_id) # belt and braces, should have been validity checked on saving already
- print(f"Cookie read: {editor_id=} reformatted as: {editor=}")
+ editor = get_cookie(request)
form = SvxForm({"filename": survex_file, "dirname": dirname, "datetime": nowtime, "outputtype": outputtype, "who_are_you":editor})