remove duplicate functions

This commit is contained in:
Matthias 2021-09-18 03:41:41 +02:00
parent dc70b5ef11
commit d363063add
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -93,52 +93,3 @@ class IntegrationPlugin(plugin.InvenTreePlugin):
def module(self, key): def module(self, key):
return key in self.mixins return key in self.mixins
def setup_urls(self):
"""
setup url endpoints for this plugin
"""
if self.urlpatterns:
return self.urlpatterns
return None
@property
def base_url(self):
return f'{settings.PLUGIN_URL}/{self.plugin_name()}/'
@property
def urlpatterns(self):
"""
retruns the urlpatterns for this plugin
"""
if self.has_urls:
return url(f'^{self.plugin_name()}/', include(self.urls), name=self.plugin_name())
return None
@property
def has_urls(self):
"""
does this plugin use custom urls
"""
return bool(self.urls)
def setup_settings(self):
"""
setup settings for this plugin
"""
if self.SETTINGS:
return self.SETTINGS
return None
@property
def has_settings(self):
"""
does this plugin use custom settings
"""
return bool(self.settings)
@property
def settingspatterns(self):
if self.has_settings:
return {f'PLUGIN_{self.plugin_name().upper()}_{key}': value for key, value in self.settings.items()}
return None