2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-17 11:17:08 +00:00

cave edit working with cookies

This commit is contained in:
2024-12-28 22:43:21 +00:00
parent ecd187e88e
commit e7444d20a4
4 changed files with 17 additions and 19 deletions

View File

@@ -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})