diff --git a/InvenTree/InvenTree/version.py b/InvenTree/InvenTree/version.py index 4d3d546789..d7bcd4f7ed 100644 --- a/InvenTree/InvenTree/version.py +++ b/InvenTree/InvenTree/version.py @@ -37,7 +37,7 @@ def inventreeCommitHash(): try: return str(subprocess.check_output('git rev-parse --short HEAD'.split()), 'utf-8').strip() - except FileNotFoundError: + except: return None @@ -47,5 +47,5 @@ def inventreeCommitDate(): try: d = str(subprocess.check_output('git show -s --format=%ci'.split()), 'utf-8').strip() return d.split(' ')[0] - except FileNotFoundError: + except: return None diff --git a/InvenTree/templates/about.html b/InvenTree/templates/about.html index cedfb40ca1..3305df430f 100644 --- a/InvenTree/templates/about.html +++ b/InvenTree/templates/about.html @@ -25,14 +25,20 @@ <td><span class='fas fa-hashtag'></span></td> <td>{% trans "Django Version" %}</td><td><a href="https://www.djangoproject.com/">{% django_version %}</a></td> </tr> + {% inventree_commit_hash as hash %} + {% if hash %} <tr> <td><span class='fas fa-code-branch'></span></td> - <td>{% trans "Commit Hash" %}</td><td><a href="https://github.com/inventree/InvenTree/commit/{% inventree_commit_hash %}">{% inventree_commit_hash %}</a></td> + <td>{% trans "Commit Hash" %}</td><td>{{ hash }}</td> </tr> + {% endif %} + {% inventree_commit_date as commit_date %} + {% if commit_date %} <tr> <td><span class='fas fa-calendar-alt'></span></td> - <td>{% trans "Commit Date" %}</td><td>{% inventree_commit_date %}</td> + <td>{% trans "Commit Date" %}</td><td>{{ commit_date }}</td> </tr> + {% endif %} <tr> <td><span class='fas fa-book'></span></td> <td>{% trans "InvenTree Documentation" %}</td>