From: olivier <> Date: Wed, 17 Feb 2010 15:36:28 +0000 (+0000) Subject: fix crash when searching by an unexisting country X-Git-Tag: 1.1~512 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=5fd5df913604911f8008a002a26c683002577f27;p=telemeta.git fix crash when searching by an unexisting country --- diff --git a/telemeta/web/base.py b/telemeta/web/base.py index 7181da12..5edff21c 100644 --- a/telemeta/web/base.py +++ b/telemeta/web/base.py @@ -239,11 +239,16 @@ class WebView(Component): for key, value in input.items(): func = switch.get(key) if func and value and value != "0": - res = func(value) - if len(res) > 2: - collections, items, value = res - else: - collections, items = res + try: + res = func(value) + if len(res) > 2: + collections, items, value = res + else: + collections, items = res + except ObjectDoesNotExist: + collections = collections.none() + items = items.none() + criteria[key] = value if type is None: