mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 03:56:43 +00:00
PEP fixes
This commit is contained in:
parent
e78a5dc104
commit
aed02f6f0f
@ -469,7 +469,7 @@ class PluginSettingsApiTest(InvenTreeAPITestCase):
|
|||||||
"""List installed plugins via API"""
|
"""List installed plugins via API"""
|
||||||
url = reverse('api-plugin-list')
|
url = reverse('api-plugin-list')
|
||||||
|
|
||||||
response = self.get(url, expected_code=200)
|
self.get(url, expected_code=200)
|
||||||
|
|
||||||
def test_api_list(self):
|
def test_api_list(self):
|
||||||
"""Test list URL"""
|
"""Test list URL"""
|
||||||
@ -479,7 +479,7 @@ class PluginSettingsApiTest(InvenTreeAPITestCase):
|
|||||||
|
|
||||||
def test_invalid_plugin_slug(self):
|
def test_invalid_plugin_slug(self):
|
||||||
"""Test that an invalid plugin slug returns a 404"""
|
"""Test that an invalid plugin slug returns a 404"""
|
||||||
|
|
||||||
url = reverse('api-plugin-setting-detail', kwargs={'plugin': 'doesnotexist', 'key': 'doesnotmatter'})
|
url = reverse('api-plugin-setting-detail', kwargs={'plugin': 'doesnotexist', 'key': 'doesnotmatter'})
|
||||||
|
|
||||||
response = self.get(url, expected_code=404)
|
response = self.get(url, expected_code=404)
|
||||||
|
@ -79,7 +79,7 @@ class LabelPrintMixin:
|
|||||||
if config and config.active:
|
if config and config.active:
|
||||||
# Only return the plugin if it is enabled!
|
# Only return the plugin if it is enabled!
|
||||||
return plugin
|
return plugin
|
||||||
|
|
||||||
# No matches found
|
# No matches found
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ class PluginSettingDetail(generics.RetrieveUpdateAPIView):
|
|||||||
|
|
||||||
if key not in settings:
|
if key not in settings:
|
||||||
raise NotFound(detail=f"Plugin '{plugin_slug}' has no setting matching '{key}'")
|
raise NotFound(detail=f"Plugin '{plugin_slug}' has no setting matching '{key}'")
|
||||||
|
|
||||||
return PluginSetting.get_setting_object(key, plugin=plugin)
|
return PluginSetting.get_setting_object(key, plugin=plugin)
|
||||||
|
|
||||||
# Staff permission required
|
# Staff permission required
|
||||||
|
@ -71,7 +71,7 @@ class PluginsRegistry:
|
|||||||
if slug not in self.plugins:
|
if slug not in self.plugins:
|
||||||
logger.warning(f"Plugin registry has no record of plugin '{slug}'")
|
logger.warning(f"Plugin registry has no record of plugin '{slug}'")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return self.plugins[slug]
|
return self.plugins[slug]
|
||||||
|
|
||||||
def call_plugin_function(self, slug, func, *args, **kwargs):
|
def call_plugin_function(self, slug, func, *args, **kwargs):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user