[filter] handle TypeError exception raised by parse_date in DateTime Filter

This commit is contained in:
Bezleputh 2014-12-30 18:03:52 +01:00 committed by Florent
commit aca28a3d5a

View file

@ -567,7 +567,7 @@ class DateTime(Filter):
for search, repl in self.translations:
txt = search.sub(repl, txt)
return parse_date(txt, dayfirst=self.dayfirst)
except ValueError as e:
except (ValueError, TypeError) as e:
return self.default_or_raise(ParseError('Unable to parse %r: %s' % (txt, e)))