forked from expo/troggle
Initial attempts at saving edited survex file
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user