[repository] drop unused argument
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 06 Jul 2012 14:01:09 +0200
changeset 8456 c912d82f2166
parent 8455 b5b263f1ad67
child 8457 69ad9a509bc3
[repository] drop unused argument
server/repository.py
--- a/server/repository.py	Mon Jul 09 09:47:28 2012 +0200
+++ b/server/repository.py	Fri Jul 06 14:01:09 2012 +0200
@@ -65,7 +65,7 @@
                            ('cw_source', 'object'),
                            ])
 
-def prefill_entity_caches(entity, relations):
+def prefill_entity_caches(entity):
     session = entity._cw
     # prefill entity relation caches
     for rschema in entity.e_schema.subject_relations():
@@ -1361,11 +1361,11 @@
         extid = self.init_entity_caches(session, entity, source)
         if server.DEBUG & server.DBG_REPO:
             print 'ADD entity', self, entity.__regid__, entity.eid, edited
-        relations = []
-        prefill_entity_caches(entity, relations)
+        prefill_entity_caches(entity)
         if source.should_call_hooks:
             self.hm.call_hooks('before_add_entity', session, entity=entity)
-        activintegrity = session.is_hook_category_activated('activeintegrity')
+        relations = []
+        activeintegrity = session.is_hook_category_activated('activeintegrity')
         for attr in edited.iterkeys():
             rschema = eschema.subjrels[attr]
             if not rschema.final: # inlined relation
@@ -1373,7 +1373,7 @@
                 relations.append((attr, value))
                 session.update_rel_cache_add(entity.eid, attr, value)
                 rdef = session.rtype_eids_rdef(attr, entity.eid, value)
-                if rdef.cardinality[1] in '1?' and activintegrity:
+                if rdef.cardinality[1] in '1?' and activeintegrity:
                     with security_enabled(session, read=False):
                         session.execute('DELETE X %s Y WHERE Y eid %%(y)s' % attr,
                                         {'x': entity.eid, 'y': value})