]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
remove redundant identity map set
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 9 Dec 2007 05:14:40 +0000 (05:14 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 9 Dec 2007 05:14:40 +0000 (05:14 +0000)
lib/sqlalchemy/orm/unitofwork.py

index 02c230d08dfdde9225bde377ed7cf57a58290fac..19642cc9d15a36a159474c2f5a06c50668fef34f 100644 (file)
@@ -122,14 +122,15 @@ class UnitOfWork(object):
             
         elif state.dict['_instance_key'] != instance_key:
             # primary key switch
-            self.identity_map[instance_key] = state.obj()
             del self.identity_map[state.dict['_instance_key']]
             state.dict['_instance_key'] = instance_key
             
         if hasattr(state, 'insert_order'):
             delattr(state, 'insert_order')
+            
         self.identity_map[state.dict['_instance_key']] = state.obj()
         state.commit_all()
+        
         # remove from new last, might be the last strong ref
         self.new.pop(state, None)