From 30a0d9a8921eeae80c3026004059a93421ec3287 Mon Sep 17 00:00:00 2001 From: fritz Date: Wed, 9 Oct 2024 00:41:02 +0100 Subject: [PATCH] Increase compatibility --- tryton-scripts/beitragsrechnungen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tryton-scripts/beitragsrechnungen.py b/tryton-scripts/beitragsrechnungen.py index d4c9b92..4a5efc1 100644 --- a/tryton-scripts/beitragsrechnungen.py +++ b/tryton-scripts/beitragsrechnungen.py @@ -121,14 +121,14 @@ with triad.client.Session.start(args.url, args.username, args.password) as sessi try: monthly_fee = decimal.Decimal(member['monthly_fee']) except: - print(f"\tInvalid monthly fee: {member['monthly_fee']}", file=sys.stderr) + print(f"\tInvalid monthly fee: {member.get('monthly_fee')}", file=sys.stderr) monthly_fee = None else: print(f"\tMonthly fee: {monthly_fee}", file=sys.stderr) try: yearly_fee = decimal.Decimal(member['yearly_fee']) except: - print(f'\tInvalid yearly fee: {member['yearly_fee']}', file=sys.stderr) + print(f'\tInvalid yearly fee: {member.get("yearly_fee")}', file=sys.stderr) yearly_fee = None else: print(f'\tYearly fee: {yearly_fee}', file=sys.stderr)