Merge pull request #2491 from SchrodingersGat/double-bug-fix

Plugin API fix
This commit is contained in:
Oliver 2021-12-31 17:21:00 +11:00 committed by GitHub
commit c6330608e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 6 deletions

View File

@ -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

View File

@ -1,7 +1,10 @@
{% load i18n %}
{% load plugin_extras %}
<h4>{% trans "Settings" %}</h4>
<div class='panel-heading'>
<h4>{% trans "Settings" %}</h4>
</div>
{% plugin_globalsettings plugin_key as plugin_settings %}
<table class='table table-striped table-condensed'>

View File

@ -1,7 +1,9 @@
{% load i18n %}
{% load inventree_extras %}
<h4>{% trans "URLs" %}</h4>
<div class='panel-heading'>
<h4>{% trans "URLs" %}</h4>
</div>
{% define plugin.base_url as base %}
<p>{% blocktrans %}The Base-URL for this plugin is <a href="/{{ base }}" target="_blank"><strong>{{ base }}</strong></a>.{% endblocktrans %}</p>

View File

@ -127,8 +127,8 @@
</div>
</div>
{% mixin_enabled plugin 'globalsettings' as globalsettings %}
{% if globalsettings %}
{% mixin_enabled plugin 'settings' as settings %}
{% if settings %}
{% include 'InvenTree/settings/mixins/settings.html' %}
{% endif %}