Skip to content

Commit

Permalink
Change reserve ticket view to use the id instead of ticket name when …
Browse files Browse the repository at this point in the history
…getting tickets.
  • Loading branch information
Gabrimari committed Dec 12, 2024
1 parent 38ddec4 commit fdefcb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/bittan/bittan/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import logging

class TicketsSerializer(serializers.Serializer):
ticket_type = serializers.CharField(required=True)
ticket_type = serializers.IntegerField(required=True)
count = serializers.IntegerField(required=True, min_value=1)

class ReserveTicketRequestSerializer(serializers.Serializer):
Expand Down Expand Up @@ -77,7 +77,7 @@ def reserve_ticket(request: Request) -> Response:

for ticket in tickets:
try:
ticket_type = TicketType.objects.get(title=ticket["ticket_type"], is_visible=True)
ticket_type = TicketType.objects.get(pk=ticket["ticket_type"], is_visible=True)
except ObjectDoesNotExist:
return Response(
"TicketTypeDoesNotExist",
Expand Down

0 comments on commit fdefcb8

Please sign in to comment.