Date filter: use default value for empty input

This commit is contained in:
Romain Bignon 2014-04-28 16:41:33 +02:00
commit 6d451e5f34

View file

@ -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: