From bc7977863932c6c18915d519a24d9762ae8686ad Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 16 Nov 2021 00:14:44 +0100 Subject: [PATCH] refactor --- InvenTree/plugin/admin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/InvenTree/plugin/admin.py b/InvenTree/plugin/admin.py index cef5aa6133..5a3bd335b3 100644 --- a/InvenTree/plugin/admin.py +++ b/InvenTree/plugin/admin.py @@ -12,11 +12,11 @@ def plugin_update(queryset, new_status: bool): apps_changed = False # run through all plugins in the queryset as the save method needs to be overridden - for model in queryset: - if model.active is not new_status: - model.active = new_status + for plugin in queryset: + if plugin.active is not new_status: + plugin.active = new_status + plugin.save(no_reload=True) apps_changed = True - model.save(no_reload=True) # reload plugins if they changed if apps_changed: