aboutsummaryrefslogtreecommitdiffstats
path: root/client/views.py
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2020-08-30 23:36:17 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2020-08-30 23:36:17 +0200
commitf7fed92f02c157f1e0c1278ad78ee0f87551aea6 (patch)
treefd35c8845f347d2e765a2699db8fd48b82488d00 /client/views.py
parentadd commit id to version (diff)
downloadscout-subs-f7fed92f02c157f1e0c1278ad78ee0f87551aea6.tar.gz
scout-subs-f7fed92f02c157f1e0c1278ad78ee0f87551aea6.zip
dynamicaly check for commit id
Diffstat (limited to '')
-rw-r--r--client/views.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/client/views.py b/client/views.py
index 11ff367..01909d7 100644
--- a/client/views.py
+++ b/client/views.py
@@ -11,6 +11,7 @@ from django.template.loader import get_template
from io import BytesIO
import pdfkit
import base64
+from subprocess import check_output
def index(request):
@@ -298,5 +299,7 @@ def about(request):
version = f.read()
if version.startswith("0"):
version = "Beta " + version
- context = {"version": version}
+ commitid = check_output(["git", "rev-parse", "HEAD"]).decode()
+ version = version[:version.find(" $Id: ")]
+ context = {"version": version, "commitid": commitid}
return render(request, 'client/about.html', context)