From 9b468ba92e8f67cf9da2c127248f0ac72258a3e3 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 31 Dec 2021 15:20:32 +1100 Subject: [PATCH 1/3] Second fix for the first fix --- InvenTree/plugin/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/plugin/models.py b/InvenTree/plugin/models.py index 811ed5b431..93c6335497 100644 --- a/InvenTree/plugin/models.py +++ b/InvenTree/plugin/models.py @@ -55,9 +55,9 @@ class PluginConfig(models.Model): # extra attributes from the registry def mixins(self): - if self.plugin: + try: return self.plugin._mixinreg - else: + except (AttributeError, ValueError): return {} # functions From 553b998c9cfa2f962537653c1087a3ba3565dca2 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 31 Dec 2021 15:23:44 +1100 Subject: [PATCH 2/3] CSS fixes --- InvenTree/templates/InvenTree/settings/mixins/settings.html | 5 ++++- InvenTree/templates/InvenTree/settings/mixins/urls.html | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/InvenTree/templates/InvenTree/settings/mixins/settings.html b/InvenTree/templates/InvenTree/settings/mixins/settings.html index 3c87da8678..910d4bbfbb 100644 --- a/InvenTree/templates/InvenTree/settings/mixins/settings.html +++ b/InvenTree/templates/InvenTree/settings/mixins/settings.html @@ -1,7 +1,10 @@ {% load i18n %} {% load plugin_extras %} -

{% trans "Settings" %}

+
+

{% trans "Settings" %}

+
+ {% plugin_globalsettings plugin_key as plugin_settings %} diff --git a/InvenTree/templates/InvenTree/settings/mixins/urls.html b/InvenTree/templates/InvenTree/settings/mixins/urls.html index 4bebfbce89..0a7b029762 100644 --- a/InvenTree/templates/InvenTree/settings/mixins/urls.html +++ b/InvenTree/templates/InvenTree/settings/mixins/urls.html @@ -1,7 +1,9 @@ {% load i18n %} {% load inventree_extras %} -

{% trans "URLs" %}

+
+

{% trans "URLs" %}

+
{% define plugin.base_url as base %}

{% blocktrans %}The Base-URL for this plugin is {{ base }}.{% endblocktrans %}

From 182849e16087773177424651eb110556e62a919f Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 31 Dec 2021 15:24:56 +1100 Subject: [PATCH 3/3] Fix for settings template --- InvenTree/templates/InvenTree/settings/plugin_settings.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/templates/InvenTree/settings/plugin_settings.html b/InvenTree/templates/InvenTree/settings/plugin_settings.html index f8ab02de3e..59178300ac 100644 --- a/InvenTree/templates/InvenTree/settings/plugin_settings.html +++ b/InvenTree/templates/InvenTree/settings/plugin_settings.html @@ -127,8 +127,8 @@ -{% mixin_enabled plugin 'globalsettings' as globalsettings %} -{% if globalsettings %} +{% mixin_enabled plugin 'settings' as settings %} +{% if settings %} {% include 'InvenTree/settings/mixins/settings.html' %} {% endif %}