make comperator simpler to read

This commit is contained in:
Matthias 2022-04-02 02:52:35 +02:00
parent f6aa9e4719
commit 40ff2f61aa
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -155,7 +155,11 @@ def trigger_notifaction(obj, category=None, obj_ref='pk', **kwargs):
if delivery_methods is None:
delivery_methods = inheritors(NotificationMethod)
for method in [a for a in delivery_methods if a not in [SingleNotificationMethod, BulkNotificationMethod]]:
ignored_classes = set([
SingleNotificationMethod,
BulkNotificationMethod,
])
for method in (delivery_methods - ignored_classes):
logger.info(f"Triggering method '{method.METHOD_NAME}'")
try:
deliver_notification(method, obj, category, targets, context)