Optimization...
--- a/src/pyams_notify/handlers/workflow.py Fri Jul 08 15:37:51 2016 +0200
+++ b/src/pyams_notify/handlers/workflow.py Wed Sep 21 22:05:33 2016 +0200
@@ -61,9 +61,9 @@
return {}
principals = set()
for context in lineage(self.context.context):
- for role_id in notified_roles:
- protection = IProtectedObject(context, None)
- if protection is not None:
+ protection = IProtectedObject(context, None)
+ if protection is not None:
+ for role_id in notified_roles:
principals |= protection.get_principals(role_id)
source_id = self.context.source['id']
if source_id in principals: