move settings

This commit is contained in:
Matthias 2022-04-02 03:03:41 +02:00
parent e95cc7c699
commit c7329da7e0
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 11 additions and 10 deletions

View File

@ -1239,14 +1239,6 @@ class InvenTreeUserSetting(BaseInvenTreeSetting):
'default': True,
'validator': bool,
},
'NOTIFICATION_SEND_EMAILS': {
'name': _('Enable email notifications'),
'description': _('Allow sending of emails for event notifications'),
'default': True,
'validator': bool,
},
'LABEL_ENABLE': {
'name': _('Enable label printing'),
'description': _('Enable label printing from the web interface'),

View File

@ -6,12 +6,12 @@ from django.utils.translation import ugettext_lazy as _
from allauth.account.models import EmailAddress
from plugin import IntegrationPluginBase
from plugin.mixins import BulkNotificationMethod
from plugin.mixins import BulkNotificationMethod, SettingsMixin
from common.models import InvenTreeUserSetting
import InvenTree.tasks
class CoreNotificationsPlugin(IntegrationPluginBase):
class CoreNotificationsPlugin(SettingsMixin, IntegrationPluginBase):
"""
Core notification methods for InvenTree
"""
@ -20,6 +20,15 @@ class CoreNotificationsPlugin(IntegrationPluginBase):
AUTHOR = _('InvenTree contributors')
DESCRIPTION = _('Integrated outgoing notificaton methods')
SETTINGS = {
'NOTIFICATION_SEND_EMAILS': {
'name': _('Enable email notifications'),
'description': _('Allow sending of emails for event notifications'),
'default': True,
'validator': bool,
},
}
class EmailNotification(BulkNotificationMethod):
METHOD_NAME = 'mail'
CONTEXT_EXTRA = [