Initial attempts at saving edited survex file

This commit is contained in:
2023-03-05 23:06:06 +00:00
parent d5887e8f99
commit 8fc25de794
2 changed files with 58 additions and 3 deletions

View File

@@ -21,6 +21,7 @@ from troggle.core.models.caves import Cave
from troggle.core.models.survex import SurvexFile, SurvexBlock
from troggle.core.models.wallets import Wallet
from troggle.core.utils import only_commit
from troggle.parsers.survex import parse_one_file
"""Everything that views survexfiles
but also displays data on a cave or caves when there is ambiguity
@@ -198,6 +199,10 @@ class SvxForm(forms.Form):
comment = f"Online survex edit: {self.data['filename']}.svx on dev machine '{socket.gethostname()}' "
only_commit(fname, comment)
parse_one_file(self.data["filename"])
return "SAVED and committed to git (if there were differences)"
def Process(self):
@@ -307,9 +312,9 @@ def svx(request, survex_file):
warning = True
if not difflist:
if svxfile:
difflist.append("No differences.")
difflist.append("No differences from last saved file.")
else:
difflist.append("No differences from initial template.")
difflist.append("No differences from last saved file (or from initial template).")
if message:
difflist.insert(0, message)