2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-19 11:16:31 +00:00

PEP fixes

This commit is contained in:
Matthias
2021-11-15 02:10:43 +01:00
parent c41f16837d
commit 1aafec7107
2 changed files with 3 additions and 4 deletions

View File

@@ -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