merge
authorSandrine Ribeau <sandrine.ribeau@logilab.fr>
Mon, 07 Dec 2009 09:10:36 -0800
changeset 4020 65ee20fb9078
parent 4019 7f68077d2c3b (current diff)
parent 4010 b2d0b14a365d (diff)
child 4022 934e758a73ef
merge
--- a/server/hook.py	Mon Dec 07 08:52:38 2009 -0800
+++ b/server/hook.py	Mon Dec 07 09:10:36 2009 -0800
@@ -82,7 +82,7 @@
             if hook.enabled:
                 hook()
             else:
-                warn('[3.6] %s: enabled is deprecated' % cls)
+                warn('[3.6] %s: enabled is deprecated' % self.__class__)
 
 VRegistry.REGISTRY_FACTORY['hooks'] = HooksRegistry
 
--- a/server/schemaserial.py	Mon Dec 07 08:52:38 2009 -0800
+++ b/server/schemaserial.py	Mon Dec 07 09:10:36 2009 -0800
@@ -202,7 +202,9 @@
                                   internationalizable=i18n,
                                   default=default, eid=rdefeid)
         rdefs = schema.add_relation_def(rdef)
-        set_perms(rdefs, permsdict.get(rdefeid, {}))
+        # rdefs can be None on duplicated relation definitions (e.g. symetrics)
+        if rdefs:
+            set_perms(rdefs, permsdict.get(rdefeid, {}))
     for values in session.execute(
         'Any X,SE,RT,OE,CARD,ORD,DESC,C WHERE X is CWRelation, X relation_type RT,'
         'X cardinality CARD, X ordernum ORD, X description DESC, '
@@ -217,7 +219,9 @@
                                   composite=c, constraints=constraints,
                                   eid=rdefeid)
         rdefs = schema.add_relation_def(rdef)
-        set_perms(rdefs, permsdict.get(rdefeid, {}))
+        # rdefs can be None on duplicated relation definitions (e.g. symetrics)
+        if rdefs:
+            set_perms(rdefs, permsdict.get(rdefeid, {}))
     schema.infer_specialization_rules()
     if _3_2_migration:
         _update_database(schema, sqlcu)