diff --git a/InvenTree/plugin/models.py b/InvenTree/plugin/models.py index 4aebcd6082..73bd09dc3a 100644 --- a/InvenTree/plugin/models.py +++ b/InvenTree/plugin/models.py @@ -47,14 +47,14 @@ class PluginConfig(models.Model): if not self.active: name += '(not active)' return name - + def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.__org_active = self.active def save(self, force_insert=False, force_update=False, *args, **kwargs): """extend save method to reload plugins if the 'active' status changes""" - ret = super().save(force_insert, force_update, *args, **kwargs) + ret = super().save(force_insert, force_update, *args, **kwargs) app = apps.get_app_config('plugin') if self.active is False and self.__org_active is True: @@ -64,4 +64,3 @@ class PluginConfig(models.Model): app.reload_plugins() return ret - diff --git a/InvenTree/plugin/plugins.py b/InvenTree/plugin/plugins.py index d29b8093da..0822e412f3 100644 --- a/InvenTree/plugin/plugins.py +++ b/InvenTree/plugin/plugins.py @@ -29,7 +29,7 @@ def get_modules(pkg, recursive: bool = False): """get all modules in a package""" if not recursive: return [importlib.import_module(name) for finder, name, ispkg in iter_namespace(pkg)] - + context = {} for loader, name, ispkg in pkgutil.walk_packages(pkg.__path__): try: