cleanup stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 29 Sep 2011 15:28:41 +0200
branchstable
changeset 7895 0a967180794b
parent 7893 8da3caff3291
child 7897 defac26f4151
cleanup
server/repository.py
server/sources/pyrorql.py
--- a/server/repository.py	Thu Sep 29 14:46:41 2011 +0200
+++ b/server/repository.py	Thu Sep 29 15:28:41 2011 +0200
@@ -1177,8 +1177,7 @@
         # delete remaining relations: if user can delete the entity, he can
         # delete all its relations without security checking
         with security_enabled(session, read=False, write=False):
-            eids = [_e.eid for _e in entities]
-            in_eids = ','.join((str(eid) for eid in eids))
+            in_eids = ','.join([str(_e.eid) for _e in entities])
             for rschema, _, role in entities[0].e_schema.relation_definitions():
                 rtype = rschema.type
                 if rtype in schema.VIRTUAL_RTYPES or rtype in pendingrtypes:
--- a/server/sources/pyrorql.py	Thu Sep 29 14:46:41 2011 +0200
+++ b/server/sources/pyrorql.py	Thu Sep 29 15:28:41 2011 +0200
@@ -445,7 +445,7 @@
 
     def delete_entity(self, session, entity):
         """delete an entity from the source"""
-        if session.deleted_in_transaction (self.eid):
+        if session.deleted_in_transaction(self.eid):
             # source is being deleted, don't propagate
             self._query_cache.clear()
             return
@@ -466,7 +466,7 @@
 
     def delete_relation(self, session, subject, rtype, object):
         """delete a relation from the source"""
-        if session.deleted_in_transaction (self.eid):
+        if session.deleted_in_transaction(self.eid):
             # source is being deleted, don't propagate
             self._query_cache.clear()
             return