# HG changeset patch # User Sylvain Thénault # Date 1305905235 -7200 # Node ID 47c8009dbbe2a51b6cc0c468c502a930614f668a # Parent 9ad9ce340c5f43a56483d7d261268b24ad20b3a1 [migractions] dropped_constraints should accept only droprequired without cstrtype diff -r 9ad9ce340c5f -r 47c8009dbbe2 server/migractions.py --- a/server/migractions.py Fri May 20 17:20:51 2011 +0200 +++ b/server/migractions.py Fri May 20 17:27:15 2011 +0200 @@ -1424,7 +1424,7 @@ return self.cmd_create_entity(etype, *args, **kwargs).eid @contextmanager - def cmd_dropped_constraints(self, etype, attrname, cstrtype, + def cmd_dropped_constraints(self, etype, attrname, cstrtype=None, droprequired=False): """context manager to drop constraints temporarily on fs_schema @@ -1444,8 +1444,9 @@ rdef = self.fs_schema.eschema(etype).rdef(attrname) original_constraints = rdef.constraints # remove constraints - rdef.constraints = [cstr for cstr in original_constraints - if not (cstrtype and isinstance(cstr, cstrtype))] + if cstrtype: + rdef.constraints = [cstr for cstr in original_constraints + if not (cstrtype and isinstance(cstr, cstrtype))] if droprequired: original_cardinality = rdef.cardinality rdef.cardinality = '?' + rdef.cardinality[1]