mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Hide git information if there is an error
This commit is contained in:
parent
53c9475e6d
commit
6412cf1c87
@ -37,7 +37,7 @@ def inventreeCommitHash():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
return str(subprocess.check_output('git rev-parse --short HEAD'.split()), 'utf-8').strip()
|
return str(subprocess.check_output('git rev-parse --short HEAD'.split()), 'utf-8').strip()
|
||||||
except FileNotFoundError:
|
except:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
@ -47,5 +47,5 @@ def inventreeCommitDate():
|
|||||||
try:
|
try:
|
||||||
d = str(subprocess.check_output('git show -s --format=%ci'.split()), 'utf-8').strip()
|
d = str(subprocess.check_output('git show -s --format=%ci'.split()), 'utf-8').strip()
|
||||||
return d.split(' ')[0]
|
return d.split(' ')[0]
|
||||||
except FileNotFoundError:
|
except:
|
||||||
return None
|
return None
|
||||||
|
@ -25,14 +25,20 @@
|
|||||||
<td><span class='fas fa-hashtag'></span></td>
|
<td><span class='fas fa-hashtag'></span></td>
|
||||||
<td>{% trans "Django Version" %}</td><td><a href="https://www.djangoproject.com/">{% django_version %}</a></td>
|
<td>{% trans "Django Version" %}</td><td><a href="https://www.djangoproject.com/">{% django_version %}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{% inventree_commit_hash as hash %}
|
||||||
|
{% if hash %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-code-branch'></span></td>
|
<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>
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
{% inventree_commit_date as commit_date %}
|
||||||
|
{% if commit_date %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-calendar-alt'></span></td>
|
<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>
|
</tr>
|
||||||
|
{% endif %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-book'></span></td>
|
<td><span class='fas fa-book'></span></td>
|
||||||
<td>{% trans "InvenTree Documentation" %}</td>
|
<td>{% trans "InvenTree Documentation" %}</td>
|
||||||
|
Loading…
Reference in New Issue
Block a user