From febc51466aec25a95ca35506fef6132d7a197e2e Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 4 Dec 2021 02:13:53 +0100 Subject: [PATCH] use a more gnerall counting method --- 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 86b9a922b1..096cf86814 100644 --- a/InvenTree/common/notifications.py +++ b/InvenTree/common/notifications.py @@ -164,7 +164,7 @@ def deliver_notification(cls: NotificationMethod, obj, entry_name: str, receiver # Init delivery method method = cls(obj, entry_name, receivers) - if method.recipients and method.recipients.count() > 0: + if method.recipients and len(method.recipients) > 0: # Log start logger.info(f"Notify users via '{method.METHOD_NAME}' for notification '{entry_name}' for '{str(obj)}'") @@ -177,7 +177,7 @@ def deliver_notification(cls: NotificationMethod, obj, entry_name: str, receiver # Select delivery method and execute it if hasattr(method, 'send_bulk'): success = method.send_bulk(notification_context) - success_count = method.recipients.count() + success_count = len(method.recipients) elif hasattr(method, 'send'): for rec in method.recipients: