From 015a00f7a3439777d3cef03ee058c95b9f50a39a Mon Sep 17 00:00:00 2001 From: Daniel Kim Date: Sun, 8 Dec 2019 14:50:10 -0500 Subject: [PATCH] Added another exception for catching errors related to mail --- ihatemoney/models.py | 3 +++ ihatemoney/templates/list_bills.html | 2 ++ ihatemoney/web.py | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ihatemoney/models.py b/ihatemoney/models.py index 63b43e3c..5cbc974d 100644 --- a/ihatemoney/models.py +++ b/ihatemoney/models.py @@ -377,6 +377,9 @@ class Bill(db.Model): "creation_date": self.creation_date, "what": self.what, "external_link": self.external_link, + "original_currency": self.original_currency, + "original_amount": self.original_amount, + } def pay_each(self): diff --git a/ihatemoney/templates/list_bills.html b/ihatemoney/templates/list_bills.html index 84f72994..f9a2a9f8 100644 --- a/ihatemoney/templates/list_bills.html +++ b/ihatemoney/templates/list_bills.html @@ -121,6 +121,8 @@ {{ bill.owers|join(', ', 'name') }} {%- endif %} {{ "%0.2f"|format(bill.amount) }} ({{ "%0.2f"|format(bill.pay_each()) }} {{ _("each") }}) + {{ bill.original_currency }} + {{ bill.original_amount }} {{ _('edit') }} {{ _('delete') }} diff --git a/ihatemoney/web.py b/ihatemoney/web.py index 3c8c6da4..819a5e45 100644 --- a/ihatemoney/web.py +++ b/ihatemoney/web.py @@ -299,7 +299,7 @@ def create_project(): ) try: current_app.mail.send(msg) - except SMTPRecipientsRefused: + except (SMTPRecipientsRefused, ConnectionRefusedError): msg_compl = "Problem sending mail. " # TODO: destroy the project and cancel instead? else: