# HG changeset patch # User BenoƮt Allard # Date 1414140767 -7200 # Node ID 5b47af23547f24e8bb0795ed4b876fb0be6d041f # Parent d2588d88d47a43ce6c8888b1dcf30650188c8c3c Add possibility for parseDate to return None, shouldn't happen since we also do client-side validation. diff -r d2588d88d47a -r 5b47af23547f farol/controller.py --- a/farol/controller.py Fri Oct 24 10:52:04 2014 +0200 +++ b/farol/controller.py Fri Oct 24 10:52:47 2014 +0200 @@ -89,6 +89,9 @@ except AttributeError: pass # Absorb AttributeError, and try to parse it a second time ... m = re.match('(\d{4})-(\d{2})-(\d{2})', string) + if m is None: + flash('Cannot parse date: "%s"' % string, 'warning') + return None return datetime(int(m.group(1)), int(m.group(2)), int(m.group(3)), tzinfo=timezone(timedelta(hours=0, minutes=0)))