[adapters] fix a name stomping error (entity) stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Mon, 13 Jan 2014 15:27:35 +0100
branchstable
changeset 9433 dd708175dc43
parent 9432 030745ac9873
child 9434 060bd51c6779
[adapters] fix a name stomping error (entity) Also give proper name to subject (role, not target), and kill unused variable.
entities/adapters.py
--- a/entities/adapters.py	Mon Jan 13 15:17:11 2014 +0100
+++ b/entities/adapters.py	Mon Jan 13 15:27:35 2014 +0100
@@ -106,17 +106,16 @@
         _done.add(entity.eid)
         containers = tuple(entity.e_schema.fulltext_containers())
         if containers:
-            for rschema, target in containers:
-                if target == 'object':
+            for rschema, role in containers:
+                if role == 'object':
                     targets = getattr(entity, rschema.type)
                 else:
                     targets = getattr(entity, 'reverse_%s' % rschema)
-                for entity in targets:
-                    if entity.eid in _done:
+                for target in targets:
+                    if target.eid in _done:
                         continue
-                    for container in entity.cw_adapt_to('IFTIndexable').fti_containers(_done):
+                    for container in target.cw_adapt_to('IFTIndexable').fti_containers(_done):
                         yield container
-                        yielded = True
         else:
             yield entity