hooks/storages.py
branchstable
changeset 4721 8f63691ccb7f
parent 4719 aaed3f813ef8
--- a/hooks/storages.py	Fri Feb 26 13:21:13 2010 +0100
+++ b/hooks/storages.py	Fri Feb 26 13:24:47 2010 +0100
@@ -26,8 +26,9 @@
     events = ('before_update_entity', )
 
     def __call__(self):
-        for attr in ETYPE_ATTR_STORAGE.get(self.entity.__regid__, ()):
-            ETYPE_ATTR_STORAGE[self.entity.__regid__][attr].entity_updated(self.entity, attr)
+        etype = self.entity.__regid__
+        for attr in ETYPE_ATTR_STORAGE.get(etype, ()):
+            ETYPE_ATTR_STORAGE[etype][attr].entity_updated(self.entity, attr)
 
 class PreDeleteEntityHook(BFSSHook):
     """"""
@@ -35,5 +36,6 @@
     events = ('before_delete_entity', )
 
     def __call__(self):
-        for attr in ETYPE_ATTR_STORAGE.get(self.entity.__regid__, ()):
-            ETYPE_ATTR_STORAGE[self.entity.__regid__][attr].entity_deleted(self.entity, attr)
+        etype = self.entity.__regid__
+        for attr in ETYPE_ATTR_STORAGE.get(etype, ()):
+            ETYPE_ATTR_STORAGE[etype][attr].entity_deleted(self.entity, attr)