[filter] handle TypeError exception raised by parse_date in DateTime Filter
This commit is contained in:
parent
76da33368f
commit
aca28a3d5a
1 changed files with 1 additions and 1 deletions
|
|
@ -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)))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue