]> git.ipfire.org Git - thirdparty/python-drafthorse.git/commitdiff
Fix #32 -- Parsing of amount without currency
authorRaphael Michel <michel@rami.io>
Fri, 4 Oct 2024 13:12:12 +0000 (15:12 +0200)
committerRaphael Michel <michel@rami.io>
Fri, 4 Oct 2024 13:12:12 +0000 (15:12 +0200)
drafthorse/models/container.py

index 8219378a1187d4423fd9f28d91d407afe9e2e309..eb1755e04f7c65ffd446a296410ea44626dc29c2 100644 (file)
@@ -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):