raise ParseError only with None/NotAvailable/NotLoaded values, not with empty strings
This commit is contained in:
parent
6ea5b16971
commit
a96b738242
1 changed files with 3 additions and 3 deletions
|
|
@ -315,10 +315,10 @@ class CleanDecimal(CleanText):
|
||||||
self.replace_dots = replace_dots
|
self.replace_dots = replace_dots
|
||||||
|
|
||||||
def filter(self, text):
|
def filter(self, text):
|
||||||
if empty(text) or text == '':
|
if empty(text):
|
||||||
return self.default_or_raise(ParseError('Unable to parse %r' % 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 self.replace_dots:
|
||||||
if type(self.replace_dots) is tuple:
|
if type(self.replace_dots) is tuple:
|
||||||
thousands_sep, decimal_sep = self.replace_dots
|
thousands_sep, decimal_sep = self.replace_dots
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue