when modifying a persistent schema, erschema may miss some permissions which wil trigger a key error, but we don't want to crash on such cases stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 18 Feb 2010 12:57:57 +0100
branchstable
changeset 4631 457160bc8cfe
parent 4630 528dee042927
child 4632 8ac40462bad0
when modifying a persistent schema, erschema may miss some permissions which wil trigger a key error, but we don't want to crash on such cases
server/schemaserial.py
--- a/server/schemaserial.py	Thu Feb 18 12:52:34 2010 +0100
+++ b/server/schemaserial.py	Thu Feb 18 12:57:57 2010 +0100
@@ -472,7 +472,12 @@
     and CWGroup entities
     """
     for action in erschema.ACTIONS:
-        for group_or_rqlexpr in erschema.action_permissions(action):
+        try:
+            grantedto = erschema.action_permissions(action)
+        except KeyError:
+            # may occurs when modifying persistent schema
+            continue
+        for group_or_rqlexpr in grantedto:
             if isinstance(group_or_rqlexpr, basestring):
                 # group
                 try: