mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-06 13:01:50 +02:00
Added another exception for catching errors related to mail
This commit is contained in:
parent
13687c198e
commit
015a00f7a3
3 changed files with 6 additions and 1 deletions
|
@ -377,6 +377,9 @@ class Bill(db.Model):
|
||||||
"creation_date": self.creation_date,
|
"creation_date": self.creation_date,
|
||||||
"what": self.what,
|
"what": self.what,
|
||||||
"external_link": self.external_link,
|
"external_link": self.external_link,
|
||||||
|
"original_currency": self.original_currency,
|
||||||
|
"original_amount": self.original_amount,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def pay_each(self):
|
def pay_each(self):
|
||||||
|
|
|
@ -121,6 +121,8 @@
|
||||||
{{ bill.owers|join(', ', 'name') }}
|
{{ bill.owers|join(', ', 'name') }}
|
||||||
{%- endif %}</td>
|
{%- endif %}</td>
|
||||||
<td>{{ "%0.2f"|format(bill.amount) }} ({{ "%0.2f"|format(bill.pay_each()) }} {{ _("each") }})</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">
|
<td class="bill-actions">
|
||||||
<a class="edit" href="{{ url_for(".edit_bill", bill_id=bill.id) }}" title="{{ _("edit") }}">{{ _('edit') }}</a>
|
<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>
|
<a class="delete" href="{{ url_for(".delete_bill", bill_id=bill.id) }}" title="{{ _("delete") }}">{{ _('delete') }}</a>
|
||||||
|
|
|
@ -299,7 +299,7 @@ def create_project():
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
current_app.mail.send(msg)
|
current_app.mail.send(msg)
|
||||||
except SMTPRecipientsRefused:
|
except (SMTPRecipientsRefused, ConnectionRefusedError):
|
||||||
msg_compl = "Problem sending mail. "
|
msg_compl = "Problem sending mail. "
|
||||||
# TODO: destroy the project and cancel instead?
|
# TODO: destroy the project and cancel instead?
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue