mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
author information for integration plugin
This commit is contained in:
parent
cec29310dc
commit
575be5b36a
@ -9,6 +9,7 @@ import inspect
|
|||||||
from django.conf.urls import url, include
|
from django.conf.urls import url, include
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils.text import slugify
|
from django.utils.text import slugify
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
import plugins.plugin as plugin
|
import plugins.plugin as plugin
|
||||||
|
|
||||||
@ -255,6 +256,8 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
|||||||
"""
|
"""
|
||||||
PLUGIN_SLUG = None
|
PLUGIN_SLUG = None
|
||||||
|
|
||||||
|
AUTHOR = None
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.add_mixin('base')
|
self.add_mixin('base')
|
||||||
@ -280,6 +283,16 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
|||||||
name = self.plugin_name()
|
name = self.plugin_name()
|
||||||
return name
|
return name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def author(self):
|
||||||
|
"""returns author of plugin - either from plugin settings or git"""
|
||||||
|
name = getattr(self, 'AUTHOR', None)
|
||||||
|
if not name:
|
||||||
|
name = self.commit.get('author')
|
||||||
|
if not name:
|
||||||
|
name = _('No author found')
|
||||||
|
return name
|
||||||
|
|
||||||
# mixins
|
# mixins
|
||||||
def mixin(self, key):
|
def mixin(self, key):
|
||||||
"""check if mixin is registered"""
|
"""check if mixin is registered"""
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td># TODO</td>
|
<td>{{ plugin.author }}</td>
|
||||||
<td>{{plugin.commit.date}}</td>
|
<td>{{plugin.commit.date}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user