Increase compatibility

This commit is contained in:
fritz 2024-10-09 00:41:02 +01:00
parent 95a856ef73
commit 30a0d9a892

View file

@ -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)