server/sources/native.py
branchstable
changeset 5011 57c4c6399b44
parent 4964 d9e8af8a7a42
child 5013 ad91f93bbb93
--- a/server/sources/native.py	Thu Mar 25 13:44:24 2010 +0100
+++ b/server/sources/native.py	Thu Mar 25 13:46:55 2010 +0100
@@ -428,10 +428,14 @@
         orig_values = {}
         etype = entity.__regid__
         for attr, storage in self._storages.get(etype, {}).items():
-            if attr in entity.edited_attributes:
-                orig_values[attr] = entity[attr]
-                handler = getattr(storage, 'entity_%s' % event)
-                handler(entity, attr)
+            try:
+                if attr in entity.edited_attributes:
+                    orig_values[attr] = entity[attr]
+                    handler = getattr(storage, 'entity_%s' % event)
+                    handler(entity, attr)
+            except AttributeError:
+                assert event == 'deleted'
+                getattr(storage, 'entity_deleted')(entity, attr)
         yield # 2/ execute the source's instructions
         # 3/ restore original values
         for attr, value in orig_values.items():