Update version

- Display django version in "about" dialog
This commit is contained in:
Oliver Walters 2020-04-20 01:20:09 +10:00
parent c72fce0cc5
commit 57fa69f6e6
3 changed files with 18 additions and 2 deletions

View File

@ -4,8 +4,9 @@ Provides information on the current InvenTree version
import subprocess
from common.models import InvenTreeSetting
import django
INVENTREE_SW_VERSION = "0.0.11_pre"
INVENTREE_SW_VERSION = "0.0.12 pre"
def inventreeInstanceName():
@ -18,6 +19,11 @@ def inventreeVersion():
return INVENTREE_SW_VERSION
def inventreeDjangoVersion():
""" Return the version of Django library """
return django.get_version()
def inventreeCommitHash():
""" Returns the git commit hash for the running codebase """

View File

@ -55,6 +55,12 @@ def inventree_version(*args, **kwargs):
return version.inventreeVersion()
@register.simple_tag()
def django_version(*args, **kwargs):
""" Return Django version string """
return version.inventreeDjangoVersion()
@register.simple_tag()
def inventree_commit_hash(*args, **kwargs):
""" Return InvenTree git commit hash string """

View File

@ -25,6 +25,10 @@
<td><span class='fas fa-hashtag'></span></td>
<td>{% trans "InvenTree Version" %}</td><td><a href="https://github.com/inventree/InvenTree/releases">{% inventree_version %}</a></td>
</tr>
<tr>
<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>
<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>
@ -45,7 +49,7 @@
<tr>
<td><span class='fas fa-exclamation-circle'></span></td>
<td>{% trans "Submit Bug Report" %}</td>
<td><a href='{% inventree_github_url %}/issues'>{% inventree_github_url %}/issues</a></td>
<td><a href='{% inventree_github_url %}/issues'>{% inventree_github_url %}issues</a></td>
</tr>
</table>