api: don't use 400 error code for "sold out" error (#12397)

This commit is contained in:
Frédéric Péters 2016-07-20 08:48:56 +02:00
parent 792efb6852
commit e27c31583c
1 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ class Fillslot(GenericAPIView):
if event.waiting_list_places:
if event.waiting_list >= event.waiting_list_places:
return Response({'err': 1, 'reason': 'sold out'}, status.HTTP_400_BAD_REQUEST)
return Response({'err': 1, 'reason': 'sold out'})
if event.booked_places >= event.places or event.waiting_list:
# if this is full or there are people waiting, put new bookings
@ -77,7 +77,7 @@ class Fillslot(GenericAPIView):
new_booking.in_waiting_list = True
else:
if event.booked_places >= event.places:
return Response({'err': 1, 'reason': 'sold out'}, status.HTTP_400_BAD_REQUEST)
return Response({'err': 1, 'reason': 'sold out'})
new_booking.save()
response = {