# HG changeset patch # User borax@azathoth.home.ulthar.net # Date 1474488333 -7200 # Node ID 9f612bc66626f22a50ddcd9a3f08e9afceb7207d # Parent f7693c6641a9e362592d0dc7ffdb5e2f3091abf8 Optimization... diff -r f7693c6641a9 -r 9f612bc66626 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: