# HG changeset patch # User Sylvain Thénault # Date 1263983348 -3600 # Node ID 15499a46c00916251778f4cb04e2538ae8bbd1f7 # Parent 6801093af29cb5b8fffcc0727e04160dac6f6011 cleanup diff -r 6801093af29c -r 15499a46c009 server/rqlannotation.py --- a/server/rqlannotation.py Wed Jan 20 11:29:00 2010 +0100 +++ b/server/rqlannotation.py Wed Jan 20 11:29:08 2010 +0100 @@ -189,7 +189,6 @@ return rel principal = rel if principal is None: - print iter(relations).next().root raise BadRQLQuery('unable to find principal in %s' % ', '.join( r.as_string() for r in relations)) return principal @@ -310,7 +309,7 @@ # apply relation restriction self.maydeambrels = maydeambrels = {} for rel in rqlst.iget_nodes(Relation): - if rel.is_types_restriction() or rel.r_type == 'eid': + if rel.r_type == 'eid' or rel.is_types_restriction(): continue lhs, rhs = rel.get_variable_parts() if isinstance(lhs, VariableRef) or isinstance(rhs, VariableRef): @@ -385,9 +384,8 @@ for otheretype in otheretypes: reltypes = frozenset(rtypefunc(otheretype)) if var.stinfo['possibletypes'] != reltypes: - break - else: - self.restrict(var, var.stinfo['possibletypes']) - self.deambification_map[var] = deambiguifier - return True + return False + self.restrict(var, var.stinfo['possibletypes']) + self.deambification_map[var] = deambiguifier + return True return False