mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
remove duplicate functions
This commit is contained in:
parent
dc70b5ef11
commit
d363063add
@ -93,52 +93,3 @@ class IntegrationPlugin(plugin.InvenTreePlugin):
|
||||
|
||||
def module(self, key):
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user