diff --git a/InvenTree/common/notifications.py b/InvenTree/common/notifications.py index cd0cbdeedd..cbfde42cda 100644 --- a/InvenTree/common/notifications.py +++ b/InvenTree/common/notifications.py @@ -1,7 +1,6 @@ import logging from datetime import timedelta -from django.conf import settings from django.template.loader import render_to_string from allauth.account.models import EmailAddress @@ -120,6 +119,7 @@ class EmailNotification(BulkNotificationMethod): return True + class UIMessageNotification(SingleNotificationMethod): METHOD_NAME = 'ui_message' @@ -128,12 +128,12 @@ class UIMessageNotification(SingleNotificationMethod): def send(self, target): NotificationMessage.objects.create( - target_object = self.obj, - source_object = target, - user = target, - category = self.category, - name = self.context['name'], - message = self.context['message'], + target_object=self.obj, + source_object=target, + user=target, + category=self.category, + name=self.context['name'], + message=self.context['message'], ) # endregion # endregion diff --git a/InvenTree/common/test_notifications.py b/InvenTree/common/test_notifications.py index a6cfcba534..ba4887a456 100644 --- a/InvenTree/common/test_notifications.py +++ b/InvenTree/common/test_notifications.py @@ -43,10 +43,6 @@ class NotificationTests(BaseNotificationIntegrationTest): def get_targets(self): return [] - def setup(self): - print('running setup on WrongImplementation') - return super().setup() - with self.assertRaises(NotImplementedError): self._notification_run() @@ -59,10 +55,6 @@ class NotificationTests(BaseNotificationIntegrationTest): def get_targets(self): return [] - def setup(self): - print('running setup on WrongImplementation') - return super().setup() - with self.assertRaises(NotImplementedError): self._notification_run()