API: Allow to simulate orders

This commit is contained in:
Raphael Michel
2020-03-05 16:37:55 +01:00
parent f7fddc05dd
commit ee260c8231
4 changed files with 207 additions and 23 deletions
+3
View File
@@ -466,6 +466,9 @@ class OrderViewSet(viewsets.ModelViewSet):
send_mail = serializer._send_mail
order = serializer.instance
serializer = OrderSerializer(order, context=serializer.context)
if not order.pk:
# Simulation
return Response(serializer.data, status=status.HTTP_201_CREATED)
order.log_action(
'pretix.event.order.placed',