mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
PEP fixes
This commit is contained in:
parent
f88882da8e
commit
75c7722612
@ -1,7 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
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
|
||||||
@ -120,6 +119,7 @@ class EmailNotification(BulkNotificationMethod):
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
class UIMessageNotification(SingleNotificationMethod):
|
class UIMessageNotification(SingleNotificationMethod):
|
||||||
METHOD_NAME = 'ui_message'
|
METHOD_NAME = 'ui_message'
|
||||||
|
|
||||||
@ -128,12 +128,12 @@ class UIMessageNotification(SingleNotificationMethod):
|
|||||||
|
|
||||||
def send(self, target):
|
def send(self, target):
|
||||||
NotificationMessage.objects.create(
|
NotificationMessage.objects.create(
|
||||||
target_object = self.obj,
|
target_object=self.obj,
|
||||||
source_object = target,
|
source_object=target,
|
||||||
user = target,
|
user=target,
|
||||||
category = self.category,
|
category=self.category,
|
||||||
name = self.context['name'],
|
name=self.context['name'],
|
||||||
message = self.context['message'],
|
message=self.context['message'],
|
||||||
)
|
)
|
||||||
# endregion
|
# endregion
|
||||||
# endregion
|
# endregion
|
||||||
|
@ -43,10 +43,6 @@ class NotificationTests(BaseNotificationIntegrationTest):
|
|||||||
def get_targets(self):
|
def get_targets(self):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def setup(self):
|
|
||||||
print('running setup on WrongImplementation')
|
|
||||||
return super().setup()
|
|
||||||
|
|
||||||
with self.assertRaises(NotImplementedError):
|
with self.assertRaises(NotImplementedError):
|
||||||
self._notification_run()
|
self._notification_run()
|
||||||
|
|
||||||
@ -59,10 +55,6 @@ class NotificationTests(BaseNotificationIntegrationTest):
|
|||||||
def get_targets(self):
|
def get_targets(self):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def setup(self):
|
|
||||||
print('running setup on WrongImplementation')
|
|
||||||
return super().setup()
|
|
||||||
|
|
||||||
with self.assertRaises(NotImplementedError):
|
with self.assertRaises(NotImplementedError):
|
||||||
self._notification_run()
|
self._notification_run()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user