From 57fa69f6e66794616b9449a3826aa2a46d6a5b92 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 20 Apr 2020 01:20:09 +1000 Subject: [PATCH] Update version - Display django version in "about" dialog --- InvenTree/InvenTree/version.py | 8 +++++++- InvenTree/part/templatetags/inventree_extras.py | 6 ++++++ InvenTree/templates/about.html | 6 +++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/InvenTree/InvenTree/version.py b/InvenTree/InvenTree/version.py index 386409646a..2b0d02bfe9 100644 --- a/InvenTree/InvenTree/version.py +++ b/InvenTree/InvenTree/version.py @@ -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 """ diff --git a/InvenTree/part/templatetags/inventree_extras.py b/InvenTree/part/templatetags/inventree_extras.py index ab3b0694ac..8fa63adc0f 100644 --- a/InvenTree/part/templatetags/inventree_extras.py +++ b/InvenTree/part/templatetags/inventree_extras.py @@ -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 """ diff --git a/InvenTree/templates/about.html b/InvenTree/templates/about.html index 494d248d5e..87647eb4e7 100644 --- a/InvenTree/templates/about.html +++ b/InvenTree/templates/about.html @@ -25,6 +25,10 @@ {% trans "InvenTree Version" %}{% inventree_version %} + + + {% trans "Django Version" %}{% django_version %} + {% trans "Commit Hash" %}{% inventree_commit_hash %} @@ -45,7 +49,7 @@ {% trans "Submit Bug Report" %} - {% inventree_github_url %}/issues + {% inventree_github_url %}issues