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:
@@ -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})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user