From 6124b1207d5aa78b848c1c6d3da7938296bb1c28 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 2 Apr 2022 03:16:14 +0200 Subject: [PATCH] make setting global --- InvenTree/plugin/builtin/integration/core_notifications.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/InvenTree/plugin/builtin/integration/core_notifications.py b/InvenTree/plugin/builtin/integration/core_notifications.py index ef1598205c..2883971d04 100644 --- a/InvenTree/plugin/builtin/integration/core_notifications.py +++ b/InvenTree/plugin/builtin/integration/core_notifications.py @@ -21,7 +21,7 @@ class CoreNotificationsPlugin(SettingsMixin, IntegrationPluginBase): DESCRIPTION = _('Integrated outgoing notificaton methods') SETTINGS = { - 'NOTIFICATION_SEND_EMAILS': { + 'ENABLE_NOTIFICATION_EMAILS': { 'name': _('Enable email notifications'), 'description': _('Allow sending of emails for event notifications'), 'default': True, @@ -43,6 +43,10 @@ class CoreNotificationsPlugin(SettingsMixin, IntegrationPluginBase): only for users which allow email notifications """ + # Check if method globally enabled + if not self.get_setting('ENABLE_NOTIFICATION_EMAILS'): + return + allowed_users = [] for user in self.targets: