# HG changeset patch # User Sylvain Thénault # Date 1279034517 -7200 # Node ID fb8acdab4e12b493c1864f2cb3d1b80cd2f9618a # Parent caea22e82d839e6fb6eeec90ad42daa5daa4582c [broken schema] fix the group_mapping function in case where some standard group isn't found: we currently loop for ever, boring the user by asking ever and ever the same question... diff -r caea22e82d83 -r fb8acdab4e12 server/schemaserial.py --- a/server/schemaserial.py Tue Jul 13 16:07:41 2010 +0200 +++ b/server/schemaserial.py Tue Jul 13 17:21:57 2010 +0200 @@ -26,7 +26,7 @@ from yams import schema as schemamod, buildobjs as ybo -from cubicweb import CW_SOFTWARE_ROOT +from cubicweb import CW_SOFTWARE_ROOT, typed_eid from cubicweb.schema import (CONSTRAINTS, ETYPE_NAME_MAP, VIRTUAL_RTYPES, PURE_VIRTUAL_RTYPES) from cubicweb.server import sqlutils @@ -58,10 +58,18 @@ if not value: continue try: - res[group] = int(value) + eid = typed_eid(value) except ValueError: print 'eid should be an integer' continue + for eid_ in res.values(): + if eid == eid_: + break + else: + print 'eid is not a group eid' + continue + res[name] = eid + break return res def cstrtype_mapping(cursor):