Added another exception for catching errors related to mail

This commit is contained in:
Daniel Kim 2019-12-08 14:50:10 -05:00
parent 13687c198e
commit 015a00f7a3
3 changed files with 6 additions and 1 deletions

View file

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

View file

@ -121,6 +121,8 @@
{{ bill.owers|join(', ', 'name') }}
{%- endif %}</td>
<td>{{ "%0.2f"|format(bill.amount) }} ({{ "%0.2f"|format(bill.pay_each()) }} {{ _("each") }})</td>
<td>{{ bill.original_currency }}</td>
<td>{{ bill.original_amount }}</td>
<td class="bill-actions">
<a class="edit" href="{{ url_for(".edit_bill", bill_id=bill.id) }}" title="{{ _("edit") }}">{{ _('edit') }}</a>
<a class="delete" href="{{ url_for(".delete_bill", bill_id=bill.id) }}" title="{{ _("delete") }}">{{ _('delete') }}</a>

View file

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