CleanDecimal: do not crash with inputs like NotAvailable
This commit is contained in:
parent
a9be0e00bb
commit
59095aa85e
1 changed files with 4 additions and 1 deletions
|
|
@ -311,6 +311,9 @@ 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 == '':
|
||||||
|
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:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue