and again

This commit is contained in:
Matthias 2021-12-04 03:44:59 +01:00
parent 3a8909f0d4
commit c10841fe0e
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 3 additions and 3 deletions

View File

@ -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)}'")

View File

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