mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
make mehtod name mandatory
This commit is contained in:
parent
0f3a78c7be
commit
e18f7d49cc
@ -1,7 +1,7 @@
|
|||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from django.conf import settings
|
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
from django.template.loader import render_to_string
|
from django.template.loader import render_to_string
|
||||||
|
|
||||||
from allauth.account.models import EmailAddress
|
from allauth.account.models import EmailAddress
|
||||||
@ -24,6 +24,10 @@ class NotificationMethod:
|
|||||||
if (not hasattr(self, 'send')) and (not hasattr(self, 'send_bulk')):
|
if (not hasattr(self, 'send')) and (not hasattr(self, 'send_bulk')):
|
||||||
raise NotImplementedError('A NotificationMethod must either define a `send` or a `send_bulk` method')
|
raise NotImplementedError('A NotificationMethod must either define a `send` or a `send_bulk` method')
|
||||||
|
|
||||||
|
# No method name is no good
|
||||||
|
if self.METHOD_NAME in ('', None):
|
||||||
|
raise NotImplementedError(f'The NotificationMethod {self.__class__} did not provide a METHOD_NAME')
|
||||||
|
|
||||||
# Define arguments
|
# Define arguments
|
||||||
self.obj = obj
|
self.obj = obj
|
||||||
self.entry_name = entry_name
|
self.entry_name = entry_name
|
||||||
|
Loading…
Reference in New Issue
Block a user