fix global settings check

This commit is contained in:
Matthias 2022-04-02 03:32:27 +02:00
parent 6124b1207d
commit 6a300ea24a
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -5,7 +5,7 @@ from django.utils.translation import ugettext_lazy as _
from allauth.account.models import EmailAddress from allauth.account.models import EmailAddress
from plugin import IntegrationPluginBase from plugin import IntegrationPluginBase, registry
from plugin.mixins import BulkNotificationMethod, SettingsMixin from plugin.mixins import BulkNotificationMethod, SettingsMixin
from common.models import InvenTreeUserSetting from common.models import InvenTreeUserSetting
import InvenTree.tasks import InvenTree.tasks
@ -44,7 +44,8 @@ class CoreNotificationsPlugin(SettingsMixin, IntegrationPluginBase):
""" """
# Check if method globally enabled # 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 return
allowed_users = [] allowed_users = []