use edited_attributes and uniformize attribute schema retreival stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 14 Dec 2009 14:49:18 +0100
branchstable
changeset 4111 1fda1d356741
parent 4096 871ff503c23e
child 4112 b33a9f3e19d6
use edited_attributes and uniformize attribute schema retreival
server/hooks.py
--- a/server/hooks.py	Thu Dec 10 11:35:40 2009 -0800
+++ b/server/hooks.py	Mon Dec 14 14:49:18 2009 +0100
@@ -244,7 +244,8 @@
     if session.is_super_session:
         return
     eschema = entity.e_schema
-    for attr, val in entity.items():
+    for attr in entity.edited_attributes:
+        val = entity[attr]:
         if val is None:
             continue
         if eschema.subjrels[attr].final and \
@@ -261,7 +262,7 @@
         return
     schema = session.vreg.schema
     for attr in entity.edited_attributes:
-        if schema.rschema(attr).final:
+        if eschema.subjrels[attr].final:
             constraints = [c for c in entity.e_schema.constraints(attr)
                            if isinstance(c, (RQLConstraint, RQLUniqueConstraint))]
             if constraints: