2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

Fixes for unit tests

This commit is contained in:
Oliver
2022-01-04 21:36:27 +11:00
parent 928b90a833
commit ac849c1566
10 changed files with 116 additions and 69 deletions

View File

@ -34,17 +34,9 @@ class SettingsMixin:
Return the 'value' of the setting associated with this plugin
"""
# Find the plugin configuration associated with this plugin
return PluginSetting.get_setting(key, plugin=self)
plugin = self.plugin_config()
if plugin:
return PluginSetting.get_setting(key, plugin=plugin, settings=self.settings)
else:
# Plugin cannot be found, return default value
return PluginSetting.get_setting_default(key, settings=self.settings)
def set_setting(self, key, value, user):
def set_setting(self, key, value, user=None):
"""
Set plugin setting value by key
"""
@ -58,7 +50,7 @@ class SettingsMixin:
# Cannot find associated plugin model, return
return
PluginSetting.set_setting(key, value, user, plugin=plugin, settings=self.settings)
PluginSetting.set_setting(key, value, user, plugin=plugin)
class UrlsMixin: