Date filter: use default value for empty input
This commit is contained in:
parent
aa72812b36
commit
6d451e5f34
1 changed files with 2 additions and 2 deletions
|
|
@ -345,8 +345,8 @@ class DateTime(Filter):
|
|||
self.translations = translations
|
||||
|
||||
def filter(self, txt):
|
||||
if empty(txt):
|
||||
return txt
|
||||
if empty(txt) or txt == '':
|
||||
return self.default_or_raise(ParseError('Unable to parse %r' % txt))
|
||||
try:
|
||||
if self.translations:
|
||||
for search, repl in self.translations:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue