mirror of
https://github.com/pretix/pretix.git
synced 2026-08-25 13:12:00 +00:00
Bank transfer: Do not cause duplicate payments
This commit is contained in:
@@ -111,26 +111,22 @@ class ActionView(View):
|
|||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
p.confirm(user=self.request.user)
|
p.confirm(user=self.request.user)
|
||||||
except Quota.QuotaExceededException as e:
|
except Quota.QuotaExceededException:
|
||||||
return JsonResponse({
|
pass
|
||||||
'status': 'error',
|
|
||||||
'message': str(e)
|
|
||||||
})
|
|
||||||
except SendMailException:
|
except SendMailException:
|
||||||
return JsonResponse({
|
return JsonResponse({
|
||||||
'status': 'error',
|
'status': 'error',
|
||||||
'message': _('Problem sending email.')
|
'message': _('Problem sending email.')
|
||||||
})
|
})
|
||||||
else:
|
trans.state = BankTransaction.STATE_VALID
|
||||||
trans.state = BankTransaction.STATE_VALID
|
trans.save()
|
||||||
trans.save()
|
trans.order.payments.filter(
|
||||||
trans.order.payments.filter(
|
provider='banktransfer',
|
||||||
provider='banktransfer',
|
state__in=(OrderPayment.PAYMENT_STATE_CREATED, OrderPayment.PAYMENT_STATE_PENDING),
|
||||||
state__in=(OrderPayment.PAYMENT_STATE_CREATED, OrderPayment.PAYMENT_STATE_PENDING),
|
).update(state=OrderPayment.PAYMENT_STATE_CANCELED)
|
||||||
).update(state=OrderPayment.PAYMENT_STATE_CANCELED)
|
return JsonResponse({
|
||||||
return JsonResponse({
|
'status': 'ok',
|
||||||
'status': 'ok',
|
})
|
||||||
})
|
|
||||||
|
|
||||||
def _assign(self, trans, code):
|
def _assign(self, trans, code):
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user