diff --git a/InvenTree/common/notifications.py b/InvenTree/common/notifications.py index 63999c0c5a..bae6f6a763 100644 --- a/InvenTree/common/notifications.py +++ b/InvenTree/common/notifications.py @@ -1,7 +1,7 @@ import logging from datetime import timedelta -from django.conf import settings +from django.conf import settings from django.template.loader import render_to_string from allauth.account.models import EmailAddress @@ -24,6 +24,10 @@ class NotificationMethod: 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') + # 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 self.obj = obj self.entry_name = entry_name