and a bit more renaming

This commit is contained in:
Matthias 2021-12-04 03:44:07 +01:00
parent fc1fa775c3
commit 3a8909f0d4
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -80,7 +80,7 @@ class NotificationMethod:
def setup(self): def setup(self):
return True return True
# def send(self, receiver) # def send(self, targets)
# def send_bulk(self) # def send_bulk(self)
def cleanup(self): def cleanup(self):
@ -88,7 +88,7 @@ class NotificationMethod:
class SingleNotificationMethod(NotificationMethod): class SingleNotificationMethod(NotificationMethod):
def send(self, receiver): def send(self, target):
raise NotImplementedError('The `send` method must be overriden!') raise NotImplementedError('The `send` method must be overriden!')
@ -126,11 +126,11 @@ class UIMessageNotification(SingleNotificationMethod):
def get_recipients(self): def get_recipients(self):
return self.targets return self.targets
def send(self, receiver): def send(self, target):
NotificationMessage.objects.create( NotificationMessage.objects.create(
target_object = self.obj, target_object = self.obj,
source_object = receiver, source_object = target,
user = receiver, user = target,
category = self.entry_name, category = self.entry_name,
name = self.context['name'], name = self.context['name'],
message = self.context['message'], message = self.context['message'],