# HG changeset patch # User Sylvain Thénault # Date 1254907991 -7200 # Node ID 585c4423a54c68b5a0cddea36dea618872e9d903 # Parent 385d013c7adbd8a4c07bf3d9ba3e953feefd3afd set edited_attributes before call to pre_add_hook diff -r 385d013c7adb -r 585c4423a54c server/repository.py --- a/server/repository.py Wed Oct 07 11:32:54 2009 +0200 +++ b/server/repository.py Wed Oct 07 11:33:11 2009 +0200 @@ -1005,6 +1005,9 @@ the entity eid should originaly be None and a unique eid is assigned to the entity instance """ + # init edited_attributes before calling before_add_entity hooks + entity._is_saved = False # entity has an eid but is not yet saved + entity.edited_attributes = set(entity) entity = entity.pre_add_hook() eschema = entity.e_schema etype = str(eschema) @@ -1013,10 +1016,7 @@ entity.set_eid(self.system_source.create_eid(session)) if server.DEBUG & server.DBG_REPO: print 'ADD entity', etype, entity.eid, dict(entity) - entity._is_saved = False # entity has an eid but is not yet saved relations = [] - # init edited_attributes before calling before_add_entity hooks - entity.edited_attributes = set(entity) if source.should_call_hooks: self.hm.call_hooks('before_add_entity', etype, session, entity) # XXX use entity.keys here since edited_attributes is not updated for