[server] don't try to set perms twice on the same relation (e.g. symetric relations)
--- a/server/schemaserial.py Mon Dec 07 17:17:22 2009 +0100
+++ b/server/schemaserial.py Mon Dec 07 17:57:19 2009 +0100
@@ -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)