From fd33e5cb3fc174009572686f42cbf5962213e5e4 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Fri, 30 Apr 2021 21:52:13 +0200 Subject: [PATCH] Workaround invalid currencies --- flatisfy/email.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flatisfy/email.py b/flatisfy/email.py index 6197bc3..8fceb4c 100644 --- a/flatisfy/email.py +++ b/flatisfy/email.py @@ -111,8 +111,12 @@ def send_notification(config, flats): if area: fields.append(f"{trs['area']}: {area}m²") if cost: + if currency == '$': + currency = 'USD' + if currency == '€': + currency = 'EUR' money = Money(cost, currency).format(config["notification_lang"]) - fields.append(f"{trs['cost']}: {money}") + fields.append(f"{trs['cost']}: {money.format()}") if len(fields): txt += f'({", ".join(fields)})'