From 6a300ea24a02c07beb89575fe54a5f71359555ca Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 2 Apr 2022 03:32:27 +0200 Subject: [PATCH] fix global settings check --- InvenTree/plugin/builtin/integration/core_notifications.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/InvenTree/plugin/builtin/integration/core_notifications.py b/InvenTree/plugin/builtin/integration/core_notifications.py index 2883971d04..ba4ba138cf 100644 --- a/InvenTree/plugin/builtin/integration/core_notifications.py +++ b/InvenTree/plugin/builtin/integration/core_notifications.py @@ -5,7 +5,7 @@ from django.utils.translation import ugettext_lazy as _ from allauth.account.models import EmailAddress -from plugin import IntegrationPluginBase +from plugin import IntegrationPluginBase, registry from plugin.mixins import BulkNotificationMethod, SettingsMixin from common.models import InvenTreeUserSetting import InvenTree.tasks @@ -44,7 +44,8 @@ class CoreNotificationsPlugin(SettingsMixin, IntegrationPluginBase): """ # Check if method globally enabled - if not self.get_setting('ENABLE_NOTIFICATION_EMAILS'): + plg = registry.plugins.get(CoreNotificationsPlugin.PLUGIN_NAME.lower()) + if plg and not plg.get_setting('ENABLE_NOTIFICATION_EMAILS'): return allowed_users = []