From f0ebc3fdbfcb4d7155a8b1097b6ae204b6f391d3 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 2 Dec 2021 02:37:16 +0100 Subject: [PATCH] fix checks if function exsists --- InvenTree/common/notifications.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/common/notifications.py b/InvenTree/common/notifications.py index edea0666e0..ec38570fb7 100644 --- a/InvenTree/common/notifications.py +++ b/InvenTree/common/notifications.py @@ -134,10 +134,10 @@ def deliver_notification(cls: NotificationMethod, obj, entry_name: str, receiver if method.recipiends and method.recipiends.count() > 0: 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) - elif 'send' in method: + elif hasattr(method, 'send'): for rec in method.recipiends: method.send(rec, notification_context)