# HG changeset patch # User Sylvain Thénault # Date 1269360365 -3600 # Node ID 1e6536afa855af51ab69f50e83dd2d7e8cb2212a # Parent 7b0cd6e024e2ce7b5ddbadcc9c46a583839c0454 fix bug with damned transmutation functionality, occuring when using an INSERT query which also add relation to the entity diff -r 7b0cd6e024e2 -r 1e6536afa855 server/repository.py --- a/server/repository.py Tue Mar 23 17:05:05 2010 +0100 +++ b/server/repository.py Tue Mar 23 17:06:05 2010 +0100 @@ -975,7 +975,11 @@ # 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() + entity_ = entity.pre_add_hook() + # XXX kill that transmutation feature ! + if not entity_ is entity: + entity.__class__ = entity_.__class__ + entity.__dict__.update(entity_.__dict__) eschema = entity.e_schema etype = str(eschema) source = self.locate_etype_source(etype)