Skip to content
Commit d29d1909 authored by Quentin Defenouillere's avatar Quentin Defenouillere Committed by hydrargyrum
Browse files

weboob.browser.filters: Handle values with empty() for numeric values

Example:

```python
amount = Coalesce(
    CleanDecimal.US('//xpath', default=NotAbailable),
    CleanDecimal.US('//xpath2', default=NotAvailable),
)(self.doc)
```

If one of the CleanDecimal returns NotAvailable and the other '0.00', with
the current behavior, Coalesce will crash with "All falsy and no default"
because we use "if value" in the loop of the filter.

With empty(value), Coalesce accepts 0.00 as a valid value for numeric
elements.
parent c7b6e6d9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment