[entities] Rename variable to container to avoid name conflict
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 21 Apr 2017 16:04:49 +0200
changeset 2626 9705a695191b
parent 2625 5bfec4248b69
child 2627 7d5eca447158
[entities] Rename variable to container to avoid name conflict since it's not the same thing as the entity received in arguments.
cubicweb_seda/entities/__init__.py
--- a/cubicweb_seda/entities/__init__.py	Fri Apr 21 16:03:45 2017 +0200
+++ b/cubicweb_seda/entities/__init__.py	Fri Apr 21 16:04:49 2017 +0200
@@ -100,13 +100,13 @@
 @objectify_predicate
 def simplified_profile(cls, req, rset=None, entity=None, **kwargs):
     """Predicate returning 1 score if context entity is within a simplified profile."""
-    entity = _seda_container_from_context(rset, entity, **kwargs)
-    if entity is None:
+    container = _seda_container_from_context(rset, entity, **kwargs)
+    if container is None:
         return 0
-    if entity.cw_etype == 'SEDAArchiveUnit':
+    if container.cw_etype == 'SEDAArchiveUnit':
         # XXX archive unit component, for now suppose it's "simplified"
         return 1
-    return 1 if entity.simplified_profile else 0
+    return 1 if container.simplified_profile else 0
 
 
 def is_full_seda2_profile(entity=None, rset=None, **kwargs):