From: Raphael Michel Date: Fri, 4 Oct 2024 13:12:12 +0000 (+0200) Subject: Fix #32 -- Parsing of amount without currency X-Git-Tag: 2025.1.0~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=02f2e72e6b75b9fc357ae85f44d78e674eae2d96;p=thirdparty%2Fpython-drafthorse.git Fix #32 -- Parsing of amount without currency --- diff --git a/drafthorse/models/container.py b/drafthorse/models/container.py index 8219378..eb1755e 100644 --- a/drafthorse/models/container.py +++ b/drafthorse/models/container.py @@ -61,10 +61,7 @@ class CurrencyContainer(SimpleContainer): el._currency = child[1] def add_from_etree(self, root): - if root.attrib.get("currencyID"): - self.add((root.text, root.attrib["currencyID"])) - else: - self.add(root.text) + self.add((root.text, root.attrib.get("currencyID"))) class IDContainer(SimpleContainer):