mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
and again
This commit is contained in:
parent
3a8909f0d4
commit
c10841fe0e
@ -139,7 +139,7 @@ class UIMessageNotification(SingleNotificationMethod):
|
|||||||
# endregion
|
# endregion
|
||||||
|
|
||||||
|
|
||||||
def trigger_notifaction(obj, entry_name=None, obj_ref='pk', targets=None, receiver_fnc=None, receiver_args=[], receiver_kwargs={}, notification_context={}):
|
def trigger_notifaction(obj, entry_name=None, obj_ref='pk', targets=None, target_fnc=None, target_args=[], target_kwargs={}, notification_context={}):
|
||||||
"""
|
"""
|
||||||
Send out an notification
|
Send out an notification
|
||||||
"""
|
"""
|
||||||
@ -168,7 +168,7 @@ def trigger_notifaction(obj, entry_name=None, obj_ref='pk', targets=None, receiv
|
|||||||
logger.info(f"Gathering users for notification '{entry_name}'")
|
logger.info(f"Gathering users for notification '{entry_name}'")
|
||||||
# Collect possible targets
|
# Collect possible targets
|
||||||
if not targets:
|
if not targets:
|
||||||
targets = receiver_fnc(*receiver_args, **receiver_kwargs)
|
targets = target_fnc(*target_args, **target_kwargs)
|
||||||
|
|
||||||
if targets:
|
if targets:
|
||||||
logger.info(f"Sending notification '{entry_name}' for '{str(obj)}'")
|
logger.info(f"Sending notification '{entry_name}' for '{str(obj)}'")
|
||||||
|
@ -32,7 +32,7 @@ def notify_low_stock(part: part.models.Part):
|
|||||||
common.notifications.trigger_notifaction(
|
common.notifications.trigger_notifaction(
|
||||||
part,
|
part,
|
||||||
'part.notify_low_stock',
|
'part.notify_low_stock',
|
||||||
receiver_fnc=part.get_subscribers,
|
target_fnc=part.get_subscribers,
|
||||||
notification_context=context,
|
notification_context=context,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user