forked from CGM_Public/pretix_original
Do not sent "payment failed" email if payment is no longer expected (Z#23202699) (#5509)
This commit is contained in:
@@ -1840,6 +1840,10 @@ class OrderPayment(models.Model):
|
|||||||
))
|
))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if locked_instance.state == OrderPayment.PAYMENT_STATE_CANCELED:
|
||||||
|
# Never send mails when the payment was already canceled intentionally
|
||||||
|
send_mail = False
|
||||||
|
|
||||||
if isinstance(info, str):
|
if isinstance(info, str):
|
||||||
locked_instance.info = info
|
locked_instance.info = info
|
||||||
elif info:
|
elif info:
|
||||||
@@ -1855,6 +1859,10 @@ class OrderPayment(models.Model):
|
|||||||
'data': log_data,
|
'data': log_data,
|
||||||
}, user=user, auth=auth)
|
}, user=user, auth=auth)
|
||||||
|
|
||||||
|
if self.order.status in (Order.STATUS_PAID, Order.STATUS_CANCELED, Order.STATUS_EXPIRED):
|
||||||
|
# No reason to send mail, as the payment is no longer really expected
|
||||||
|
send_mail = False
|
||||||
|
|
||||||
if send_mail:
|
if send_mail:
|
||||||
with language(self.order.locale, self.order.event.settings.region):
|
with language(self.order.locale, self.order.event.settings.region):
|
||||||
email_subject = self.order.event.settings.mail_subject_order_payment_failed
|
email_subject = self.order.event.settings.mail_subject_order_payment_failed
|
||||||
|
|||||||
Reference in New Issue
Block a user