From ab437593741b674a01c2972306c26156b06231b4 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Thu, 2 May 2019 20:47:45 +0200 Subject: [PATCH] Fix amount fields may might not contain a decimal sign Otherwise, this breaks with Deutsche Bank Previously accepted: 1000, 1000,1 Now accepted: 1000 1000, 1000,1 --- fints/fields.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fints/fields.py b/fints/fields.py index 47d6139..39dcc33 100644 --- a/fints/fields.py +++ b/fints/fields.py @@ -150,8 +150,8 @@ class AmountField(FixedLengthMixin, DataElementField): return value _value = str(value) - if not re.match(r'^(?:0|[1-9]\d*),(?:\d*[1-9]|)$', _value): - raise TypeError("Only digits and ',' allowed for value of type 'float', no superfluous leading or trailing zeroes allowed: {!r}".format(value)) + if not re.match(r'^(?:0|[1-9]\d*)(?:,)?(?:\d*[1-9]|)$', _value): + raise TypeError("Only digits and ',' allowed for value of type 'decimal', no superfluous leading or trailing zeroes allowed: {!r}".format(value)) return decimal.Decimal(_value.replace(",", ".")) -- 2.39.5