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 import settings
|
||||
from django.utils.text import slugify
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
import plugins.plugin as plugin
|
||||
|
||||
@ -255,6 +256,8 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
||||
"""
|
||||
PLUGIN_SLUG = None
|
||||
|
||||
AUTHOR = None
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.add_mixin('base')
|
||||
@ -280,6 +283,16 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
||||
name = self.plugin_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
|
||||
def mixin(self, key):
|
||||
"""check if mixin is registered"""
|
||||
|
@ -46,7 +46,7 @@
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td># TODO</td>
|
||||
<td>{{ plugin.author }}</td>
|
||||
<td>{{plugin.commit.date}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
Loading…
Reference in New Issue
Block a user