# HG changeset patch # User Sylvain Thénault # Date 1248884861 -7200 # Node ID 961aa959f07a29a461a67ed82cc4e7031d1daf39 # Parent df34d3720ff5675be14af89de5a6b22eed4ccfca avoid execution of queries which are known to be wrong by letting error propagates diff -r df34d3720ff5 -r 961aa959f07a web/views/magicsearch.py --- a/web/views/magicsearch.py Wed Jul 29 18:25:01 2009 +0200 +++ b/web/views/magicsearch.py Wed Jul 29 18:27:41 2009 +0200 @@ -170,10 +170,7 @@ """ priority = 2 def preprocess_query(self, uquery, req): - try: - rqlst = parse(uquery, print_errors=False) - except (RQLSyntaxError, BadRQLQuery), err: - return uquery, + rqlst = parse(uquery, print_errors=False) schema = self.vreg.schema # rql syntax tree will be modified in place if necessary translate_rql_tree(rqlst, trmap(self.config, schema, req.lang), schema) @@ -204,7 +201,7 @@ elif len(words) == 3: args = self._three_words_query(*words) else: - args = self._multiple_words_query(words) + raise return args def _get_entity_type(self, word): @@ -291,11 +288,6 @@ self._complete_rql(word3, etype, searchattr=rtype)) return rql, {'text': word3} - def _multiple_words_query(self, words): - """specific process for more than 3 words query""" - return ' '.join(words), - - def _expand_shortcut(self, etype, rtype, searchstr): """Expands shortcut queries on a non final relation to use has_text or the main attribute (according to possible entity type) if '%' is used in the