Phyks (Lucas Verney) 2 months ago
parent
commit
2358bc42c5
1 changed files with 8 additions and 2 deletions
  1. 8
    2
      flatisfy/email.py

+ 8
- 2
flatisfy/email.py View File

@@ -97,8 +97,14 @@ def send_notification(config, flats):
97 97
     for flat in flats:
98 98
         title = str(flat.title)
99 99
         flat_id = str(flat.id)
100
-        area = str(int(flat.area))
101
-        cost = int(flat.cost)
100
+        try:
101
+            area = str(int(flat.area))
102
+        except (TypeError, ValueError):
103
+            area = None
104
+        try:
105
+            cost = int(flat.cost)
106
+        except (TypeError, ValueError):
107
+            cost = None
102 108
         currency = str(flat.currency)
103 109
 
104 110
         txt += f"- {title}: {website_url}#/flat/{flat_id} "