[schema changes] check entity is not being deleted and get only actually modified attributes
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 07 Aug 2009 16:49:20 +0200
changeset 2740 7ab70fad02df
parent 2739 2403260cb5b4
child 2741 148d0cea1fb5
[schema changes] check entity is not being deleted and get only actually modified attributes
server/schemahooks.py
--- a/server/schemahooks.py	Fri Aug 07 16:18:51 2009 +0200
+++ b/server/schemahooks.py	Fri Aug 07 16:49:20 2009 +0200
@@ -920,6 +920,8 @@
 
 
 def after_update_erdef(session, entity):
+    if entity.eid in session.transaction_data.get('pendingeids', ()):
+        return
     desttype = entity.otype.name
     rschema = session.schema[entity.rtype.name]
     newvalues = {}
@@ -928,7 +930,7 @@
             continue
         if prop == 'order':
             prop = 'ordernum'
-        if prop in entity:
+        if prop in entity.edited_attributes:
             newvalues[prop] = entity[prop]
     if newvalues:
         subjtype = entity.stype.name