Skip to content

Commit

Permalink
feat: Не большие изменения (недоделано).
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonVagabond committed Feb 27, 2024
1 parent 51e2282 commit 57e38ba
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions orders/views/orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from drf_spectacular.utils import extend_schema_view, extend_schema
from rest_framework import permissions, status
from rest_framework.response import Response
from rest_framework_simplejwt import authentication
from rest_framework_simplejwt import authentication as jwt_authentication

from common.views import mixins
from ..models.orders import Order
Expand All @@ -29,10 +29,9 @@
)
class OrderMakingViewSet(mixins.CreateViewSet):
"""Представление оформления заказа."""
permission_classes = (permissions.IsAuthenticated,)
authentication_classes = (authentication.JWTAuthentication,)

queryset = Order.objects.all()
authentication_classes = (jwt_authentication.JWTAuthentication,)
permission_classes = (permissions.IsAuthenticated,)
serializer_class = orders_s.OrderSerializer

def create(self, request: Request, *args: None, **kwargs: None) -> Response:
Expand Down Expand Up @@ -97,6 +96,8 @@ class OrderDetailViewSet(mixins.RUDViewSet):
)
class UserOrdersViewSet(mixins.ListViewSet):
"""Представление истории заказа пользователя."""
authentication_classes = jwt_authentication.JWTAuthentication

permission_classes = (permissions.IsAuthenticated,)

serializer_class = orders_s.UserOrderListSerializer
Expand Down

0 comments on commit 57e38ba

Please sign in to comment.