mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
fix checks if function exsists
This commit is contained in:
parent
275569dab4
commit
f0ebc3fdbf
@ -134,10 +134,10 @@ def deliver_notification(cls: NotificationMethod, obj, entry_name: str, receiver
|
|||||||
if method.recipiends and method.recipiends.count() > 0:
|
if method.recipiends and method.recipiends.count() > 0:
|
||||||
logger.info(f"Notify users via '{method.method_name}' for notification '{entry_name}' for '{str(obj)}'")
|
logger.info(f"Notify users via '{method.method_name}' for notification '{entry_name}' for '{str(obj)}'")
|
||||||
|
|
||||||
if 'send_bulk' in method:
|
if hasattr(method, 'send_bulk'):
|
||||||
method.send_bulk(notification_context)
|
method.send_bulk(notification_context)
|
||||||
|
|
||||||
elif 'send' in method:
|
elif hasattr(method, 'send'):
|
||||||
for rec in method.recipiends:
|
for rec in method.recipiends:
|
||||||
method.send(rec, notification_context)
|
method.send(rec, notification_context)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user