PEP fixes

This commit is contained in:
Oliver Walters 2022-05-08 22:53:49 +10:00
parent e78a5dc104
commit aed02f6f0f
4 changed files with 5 additions and 5 deletions

View File

@ -469,7 +469,7 @@ class PluginSettingsApiTest(InvenTreeAPITestCase):
"""List installed plugins via API"""
url = reverse('api-plugin-list')
response = self.get(url, expected_code=200)
self.get(url, expected_code=200)
def test_api_list(self):
"""Test list URL"""
@ -479,7 +479,7 @@ class PluginSettingsApiTest(InvenTreeAPITestCase):
def test_invalid_plugin_slug(self):
"""Test that an invalid plugin slug returns a 404"""
url = reverse('api-plugin-setting-detail', kwargs={'plugin': 'doesnotexist', 'key': 'doesnotmatter'})
response = self.get(url, expected_code=404)

View File

@ -79,7 +79,7 @@ class LabelPrintMixin:
if config and config.active:
# Only return the plugin if it is enabled!
return plugin
# No matches found
return None

View File

@ -147,7 +147,7 @@ class PluginSettingDetail(generics.RetrieveUpdateAPIView):
if key not in settings:
raise NotFound(detail=f"Plugin '{plugin_slug}' has no setting matching '{key}'")
return PluginSetting.get_setting_object(key, plugin=plugin)
# Staff permission required

View File

@ -71,7 +71,7 @@ class PluginsRegistry:
if slug not in self.plugins:
logger.warning(f"Plugin registry has no record of plugin '{slug}'")
return None
return self.plugins[slug]
def call_plugin_function(self, slug, func, *args, **kwargs):