Browse Source

Workaround invalid currencies

Phyks (Lucas Verney) 7 months ago
parent
commit
fd33e5cb3f
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      flatisfy/email.py

+ 5
- 1
flatisfy/email.py View File

@@ -111,8 +111,12 @@ def send_notification(config, flats):
111 111
         if area:
112 112
             fields.append(f"{trs['area']}: {area}m²")
113 113
         if cost:
114
+            if currency == '$':
115
+                currency = 'USD'
116
+            if currency == '€':
117
+                currency = 'EUR'
114 118
             money = Money(cost, currency).format(config["notification_lang"])
115
-            fields.append(f"{trs['cost']}: {money}")
119
+            fields.append(f"{trs['cost']}: {money.format()}")
116 120
 
117 121
         if len(fields):
118 122
             txt += f'({", ".join(fields)})'