[entity] User-defined relation to skip for copy has precedence stable
authorJérôme Roy <jerome.roy@logilab.fr>
Fri, 14 Mar 2014 15:19:31 +0100
branchstable
changeset 9591 5b8bc486d0dc
parent 9590 048d6de92b63
child 9592 6fd2651719bc
[entity] User-defined relation to skip for copy has precedence Otherwise permission problems can occur on rtypes not yet skipped Closes #3653459
entity.py
--- a/entity.py	Wed Feb 26 14:50:13 2014 +0100
+++ b/entity.py	Fri Mar 14 15:19:31 2014 +0100
@@ -790,13 +790,13 @@
             assert role in ('subject', 'object'), role
             skip_copy_for[role].add(rtype)
         for rschema in self.e_schema.subject_relations():
+            if rschema.type in skip_copy_for['subject']:
+                continue
             if rschema.final or rschema.meta:
                 continue
             # skip already defined relations
             if getattr(self, rschema.type):
                 continue
-            if rschema.type in skip_copy_for['subject']:
-                continue
             # skip composite relation
             rdef = self.e_schema.rdef(rschema)
             if rdef.composite: