Optimization...
authorborax@azathoth.home.ulthar.net
Wed, 21 Sep 2016 22:05:33 +0200
changeset 6 9f612bc66626
parent 5 f7693c6641a9
child 7 12370f3aa2f2
Optimization...
src/pyams_notify/handlers/workflow.py
--- 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: