mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #2491 from SchrodingersGat/double-bug-fix
Plugin API fix
This commit is contained in:
commit
c6330608e5
@ -55,9 +55,9 @@ class PluginConfig(models.Model):
|
|||||||
# extra attributes from the registry
|
# extra attributes from the registry
|
||||||
def mixins(self):
|
def mixins(self):
|
||||||
|
|
||||||
if self.plugin:
|
try:
|
||||||
return self.plugin._mixinreg
|
return self.plugin._mixinreg
|
||||||
else:
|
except (AttributeError, ValueError):
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
# functions
|
# functions
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load plugin_extras %}
|
{% load plugin_extras %}
|
||||||
|
|
||||||
<h4>{% trans "Settings" %}</h4>
|
<div class='panel-heading'>
|
||||||
|
<h4>{% trans "Settings" %}</h4>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% plugin_globalsettings plugin_key as plugin_settings %}
|
{% plugin_globalsettings plugin_key as plugin_settings %}
|
||||||
|
|
||||||
<table class='table table-striped table-condensed'>
|
<table class='table table-striped table-condensed'>
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load inventree_extras %}
|
{% load inventree_extras %}
|
||||||
|
|
||||||
<h4>{% trans "URLs" %}</h4>
|
<div class='panel-heading'>
|
||||||
|
<h4>{% trans "URLs" %}</h4>
|
||||||
|
</div>
|
||||||
{% define plugin.base_url as base %}
|
{% 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>
|
<p>{% blocktrans %}The Base-URL for this plugin is <a href="/{{ base }}" target="_blank"><strong>{{ base }}</strong></a>.{% endblocktrans %}</p>
|
||||||
|
|
||||||
|
@ -127,8 +127,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% mixin_enabled plugin 'globalsettings' as globalsettings %}
|
{% mixin_enabled plugin 'settings' as settings %}
|
||||||
{% if globalsettings %}
|
{% if settings %}
|
||||||
{% include 'InvenTree/settings/mixins/settings.html' %}
|
{% include 'InvenTree/settings/mixins/settings.html' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user