mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
and a bit more renaming
This commit is contained in:
parent
fc1fa775c3
commit
3a8909f0d4
@ -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'],
|
||||||
|
Loading…
Reference in New Issue
Block a user