generated from bisco/codex-bootstrap
fix: allow public reservation posts without csrf
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from django.shortcuts import get_object_or_404
|
||||
from rest_framework import status
|
||||
from rest_framework.decorators import api_view, throttle_classes
|
||||
from rest_framework.decorators import api_view, authentication_classes, permission_classes, throttle_classes
|
||||
from rest_framework.permissions import AllowAny
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.throttling import AnonRateThrottle
|
||||
|
||||
@@ -35,6 +36,8 @@ class ReservationConfirmThrottle(AnonRateThrottle):
|
||||
|
||||
|
||||
@api_view(["POST"])
|
||||
@authentication_classes([])
|
||||
@permission_classes([AllowAny])
|
||||
@throttle_classes([ReservationCreateThrottle])
|
||||
def create_reservation(request, performance_id):
|
||||
get_object_or_404(Performance, pk=performance_id, show__is_published=True)
|
||||
|
||||
Reference in New Issue
Block a user