Don't give card_entity when copying attributes
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 27 Jan 2017 11:29:25 +0100
changeset 2325 4cc78b323bb9
parent 2324 83d02a547cfa
child 2326 39dc69b5d190
Don't give card_entity when copying attributes else its cardinality will be considered while we want the attribute's cardinality defined in the schema. Fix test broken since f54a06d45f49
entities/profile_generation.py
--- a/entities/profile_generation.py	Wed Jan 25 21:44:02 2017 +0100
+++ b/entities/profile_generation.py	Fri Jan 27 11:29:25 2017 +0100
@@ -698,7 +698,7 @@
         elif copy_attributes:
             for attrname, occ in xselement.attributes.items():
                 if attrname in ('id', 'href') or attrname.startswith(('list', 'scheme')):
-                    parent_element = self._rng_attribute_parent(occ, card_entity, profile_element)
+                    parent_element = self._rng_attribute_parent(occ, None, profile_element)
                     self._rng_attribute(occ.target, parent_element)
         fixed_value = serialize(value)
         if fixed_value is not None: