Mercurial > moin > 1.9
changeset 3794:c62beb39c64c
queryparser: reject invalid queries consisting only of "OR"
author | Johannes Berg <johannes AT sipsolutions DOT net> |
---|---|
date | Tue, 24 Jun 2008 11:52:01 +0200 |
parents | 441a4136db05 |
children | 6e73d9be3e3f 5afc0a9e3fc3 |
files | MoinMoin/search/queryparser.py |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/search/queryparser.py Mon Jun 23 18:06:15 2008 +0200 +++ b/MoinMoin/search/queryparser.py Tue Jun 24 11:52:01 2008 +0200 @@ -960,6 +960,8 @@ # doing a "MatchAll AND_NOT someterm" for that case! orexpr = OrExpression(terms) terms = AndExpression(orexpr) + else: + raise ValueError('Nothing to OR') remaining = self._analyse_items(items) if remaining.__class__ == OrExpression: for sub in remaining.subterms():