publishing date for integration plugins

This commit is contained in:
Matthias 2021-10-04 20:00:27 +02:00
parent 575be5b36a
commit ef858f7701
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 12 additions and 1 deletions

View File

@ -257,6 +257,7 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
PLUGIN_SLUG = None
AUTHOR = None
PUBLISH_DATE = None
def __init__(self):
super().__init__()
@ -293,6 +294,16 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
name = _('No author found')
return name
@property
def pub_date(self):
"""returns publishing date of plugin - either from plugin settings or git"""
name = getattr(self, 'PUBLISH_DATE', None)
if not name:
name = self.commit.get('date')
if not name:
name = _('No date found')
return name
# mixins
def mixin(self, key):
"""check if mixin is registered"""

View File

@ -47,7 +47,7 @@
{% endif %}
</td>
<td>{{ plugin.author }}</td>
<td>{{plugin.commit.date}}</td>
<td>{{ plugin.pub_date }}</td>
</tr>
{% endfor %}
</tbody>