PEP fixes

This commit is contained in:
Matthias 2021-12-04 03:57:45 +01:00
parent f88882da8e
commit 75c7722612
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 7 additions and 15 deletions

View File

@ -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

View File

@ -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()