From 664974bbee3653b8ce30b53c400165f657b610d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 23 Nov 2011 13:04:30 +0100 Subject: [PATCH] do not fail on document number not starting with an int --- tabellio/searchform/form.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tabellio/searchform/form.py b/tabellio/searchform/form.py index 08f2c48..3bb4420 100644 --- a/tabellio/searchform/form.py +++ b/tabellio/searchform/form.py @@ -772,7 +772,10 @@ class SearchView(BrowserView): def get_no_as_int(i): if i: - return int(i.split('-')[0]) + try: + return int(i.split('-')[0]) + except ValueError: + return 99999 return 0 def cmp_dostype(x, y):