[server/sources] {before,after}_entity_insertion wants a cnx not a session
authorJulien Cristau <julien.cristau@logilab.fr>
Tue, 01 Apr 2014 16:48:14 +0200
changeset 9620 7b7d5a5d6365
parent 9619 a4e97a31cc11
child 9621 202c4797e365
[server/sources] {before,after}_entity_insertion wants a cnx not a session
server/sources/__init__.py
--- a/server/sources/__init__.py	Tue Apr 01 16:35:15 2014 +0200
+++ b/server/sources/__init__.py	Tue Apr 01 16:48:14 2014 +0200
@@ -292,7 +292,7 @@
             return wsupport
         return True
 
-    def before_entity_insertion(self, session, lid, etype, eid, sourceparams):
+    def before_entity_insertion(self, cnx, lid, etype, eid, sourceparams):
         """called by the repository when an eid has been attributed for an
         entity stored here but the entity has not been inserted in the system
         table yet.
@@ -300,12 +300,12 @@
         This method must return the an Entity instance representation of this
         entity.
         """
-        entity = self.repo.vreg['etypes'].etype_class(etype)(session)
+        entity = self.repo.vreg['etypes'].etype_class(etype)(cnx)
         entity.eid = eid
         entity.cw_edited = EditedEntity(entity)
         return entity
 
-    def after_entity_insertion(self, session, lid, entity, sourceparams):
+    def after_entity_insertion(self, cnx, lid, entity, sourceparams):
         """called by the repository after an entity stored here has been
         inserted in the system table.
         """