Skip to content

Commit 97aa615

Browse files
reviewed changes
1 parent 9b5bced commit 97aa615

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

app/eventyay/api/views/order.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,8 @@ def create(self, request, *args, **kwargs):
11921192
force=request.data.get('force', False),
11931193
send_mail=send_mail,
11941194
)
1195+
except PaymentAlreadyConfirmedException:
1196+
pass
11951197
except Quota.QuotaExceededException:
11961198
pass
11971199
except SendMailException:
@@ -1221,14 +1223,10 @@ def confirm(self, request, **kwargs):
12211223
force = request.data.get('force', False)
12221224
send_mail = request.data.get('send_email', True)
12231225

1224-
if payment.state == OrderPayment.PAYMENT_STATE_CONFIRMED:
1225-
return Response(
1226-
{'detail': f'Payment {payment.full_id} has already been confirmed.'},
1227-
status=status.HTTP_409_CONFLICT,
1228-
)
12291226
if payment.state not in (
12301227
OrderPayment.PAYMENT_STATE_PENDING,
12311228
OrderPayment.PAYMENT_STATE_CREATED,
1229+
OrderPayment.PAYMENT_STATE_CONFIRMED,
12321230
):
12331231
return Response(
12341232
{'detail': 'Invalid state of payment'},

0 commit comments

Comments
 (0)