2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

adding in license meta

This commit is contained in:
Matthias
2021-11-12 00:12:03 +01:00
parent b2478b418a
commit 61f6061edf
3 changed files with 20 additions and 0 deletions

View File

@ -275,6 +275,7 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
PUBLISH_DATE = None
VERSION = None
WEBSITE = None
LICENSE = None
def __init__(self):
super().__init__()
@ -347,6 +348,12 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
name = getattr(self, 'WEBSITE', None)
return name
@property
def license(self):
"""returns license of plugin"""
license = getattr(self, 'LICENSE', None)
return license
@property
def package_path(self):
"""returns the path to the plugin"""

View File

@ -166,6 +166,7 @@ class IntegrationPluginBaseTests(TestCase):
DESCRIPTION = 'A description'
VERSION = '1.2.3a'
WEBSITE = 'http://aa.bb/cc'
LICENSE = 'MIT'
self.plugin_name = NameIntegrationPluginBase()
@ -206,3 +207,8 @@ class IntegrationPluginBaseTests(TestCase):
self.assertEqual(self.plugin.website, None)
self.assertEqual(self.plugin_simple.website, None)
self.assertEqual(self.plugin_name.website, 'http://aa.bb/cc')
# license
self.assertEqual(self.plugin.license, None)
self.assertEqual(self.plugin_simple.license, None)
self.assertEqual(self.plugin_name.license, 'MIT')