Catch and display mail sending errors (#215)

This commit is contained in:
Tobias Kunze
2016-08-30 16:49:52 +02:00
committed by Raphael Michel
parent fe4946d591
commit 3c8f9f5a62
10 changed files with 75 additions and 34 deletions

View File

@@ -10,6 +10,7 @@ from django.utils.translation import ugettext as __, ugettext_lazy as _
from pretix.base.models import Quota
from pretix.base.payment import BasePaymentProvider
from pretix.base.services.mail import SendMailException
from pretix.base.services.orders import mark_order_paid, mark_order_refunded
from pretix.multidomain.urlreverse import build_absolute_uri
@@ -182,6 +183,8 @@ class Paypal(BasePaymentProvider):
mark_order_paid(order, 'paypal', json.dumps(payment.to_dict()))
except Quota.QuotaExceededException as e:
messages.error(request, str(e))
except SendMailException:
messages.warning(request, _('There was an error sending the confirmation mail.'))
return None
def order_pending_render(self, request, order) -> str: