summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/views/survex.py7
-rw-r--r--core/views/uploads.py8
2 files changed, 12 insertions, 3 deletions
diff --git a/core/views/survex.py b/core/views/survex.py
index c07ce2d..610ee47 100644
--- a/core/views/survex.py
+++ b/core/views/survex.py
@@ -3,6 +3,7 @@ import os
import datetime
import difflib
from pathlib import Path
+import socket
from django import forms
from django.http import HttpResponseRedirect, HttpResponse, Http404
@@ -165,7 +166,11 @@ class SvxForm(forms.Form):
res = fout.write("\n")
fout.close()
- only_commit(fname, f"Online survex edit: {self.data['filename']}.svx")
+ if socket.gethostname() == "expo":
+ comment = f"Online survex edit: {self.data['filename']}.svx"
+ else:
+ comment = f"Online survex edit: {self.data['filename']}.svx on dev machine '{socket.gethostname()}' "
+ only_commit(fname, comment)
return "SAVED and committed to git"
diff --git a/core/views/uploads.py b/core/views/uploads.py
index 3a7e67b..490b432 100644
--- a/core/views/uploads.py
+++ b/core/views/uploads.py
@@ -1,4 +1,4 @@
-import re, os
+import re, os, socket
import subprocess
import json
import settings
@@ -270,7 +270,10 @@ def scanupload(request, path=None):
print(message)
return render(request,'errors/generic.html', {'message': message})
else:
- dr_commit = subprocess.run([git, "commit", "-m", f'JSON update for wallet {wallet}'], cwd=destfolder, capture_output=True, text=True)
+ if socket.gethostname() != "expo":
+ comment = f"on dev machine '{socket.gethostname()}' "
+
+ dr_commit = subprocess.run([git, "commit", "-m", f'JSON update for wallet {wallet} {comment}'], cwd=destfolder, capture_output=True, text=True)
# This produces return code = 1 if it commits OK
if dr_commit.returncode != 0:
msgdata = 'Ask a nerd to fix this.\n\n' + dr_commit.stderr + '\n\n' + dr_commit.stdout + '\n\nreturn code: ' + str(dr_commit.returncode)
@@ -441,6 +444,7 @@ def scanupload(request, path=None):
chkpland = ""
svxfiles = []
checked = {}
+ context = {}
if waldata:
if not waldata["people"]:
waldata["people"]=["NOBODY"]