raise ParseError only with None/NotAvailable/NotLoaded values, not with empty strings

This commit is contained in:
Romain Bignon 2014-09-06 11:44:41 +02:00
commit a96b738242

View file

@ -315,10 +315,10 @@ class CleanDecimal(CleanText):
self.replace_dots = replace_dots
def filter(self, text):
if empty(text) or text == '':
if empty(text):
return self.default_or_raise(ParseError('Unable to parse %r' % text))
else:
text = super(CleanDecimal, self).filter(text)
text = super(CleanDecimal, self).filter(text)
if self.replace_dots:
if type(self.replace_dots) is tuple:
thousands_sep, decimal_sep = self.replace_dots