diff --git a/backend/tickets/views.py b/backend/tickets/views.py index 4e24793..e30c92e 100644 --- a/backend/tickets/views.py +++ b/backend/tickets/views.py @@ -102,6 +102,7 @@ def post(self, request, *args, **kwargs): order.save() return Response(response_data, status=status.HTTP_200_OK) else: + transaction.set_rollback(True) return Response({"error": "Failed to create UPI gateway", "data": response_data}, status=status.HTTP_400_BAD_REQUEST) def create_upi_data(account, txn_id, amount, phone_number, order_id):