mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
make comperator simpler to read
This commit is contained in:
parent
f6aa9e4719
commit
40ff2f61aa
@ -155,7 +155,11 @@ def trigger_notifaction(obj, category=None, obj_ref='pk', **kwargs):
|
|||||||
if delivery_methods is None:
|
if delivery_methods is None:
|
||||||
delivery_methods = inheritors(NotificationMethod)
|
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}'")
|
logger.info(f"Triggering method '{method.METHOD_NAME}'")
|
||||||
try:
|
try:
|
||||||
deliver_notification(method, obj, category, targets, context)
|
deliver_notification(method, obj, category, targets, context)
|
||||||
|
Loading…
Reference in New Issue
Block a user