From 4dbe7b8c5dccb4c1ec1157c5544dfe5795652d44 Mon Sep 17 00:00:00 2001 From: Florent Date: Mon, 5 Aug 2013 15:55:48 +0200 Subject: [PATCH] Fix OR condition Return True at the first True result, return False if no condition match Closes #1288 --- weboob/tools/application/results.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/weboob/tools/application/results.py b/weboob/tools/application/results.py index b61eb4aa..81badc96 100644 --- a/weboob/tools/application/results.py +++ b/weboob/tools/application/results.py @@ -58,14 +58,14 @@ class ResultsCondition(IResultsCondition): different = False if k in d: if different: - if d[k] == v: - return False - else: if d[k] != v: - return False + return True + else: + if d[k] == v: + return True else: raise ResultsConditionError(u'Field "%s" is not valid.' % k) - return True + return False def __str__(self): return unicode(self).encode('utf-8')