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 604c5ed commit a70087c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions carts/views/carts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from drf_spectacular.utils import extend_schema_view, extend_schema
from rest_framework import permissions
from rest_framework_simplejwt import authentication
from rest_framework import permissions, authentication

from ..models.carts import Cart, CartItem
from ..serializers.api import carts as carts_s
Expand All @@ -20,8 +19,8 @@
class CartViewSet(mixins.RetrieveListViewSet):
"""Представление корзины."""

permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
authentication_classes = (authentication.JWTAuthentication,)
permission_classes = (permissions.BasePermission,)
authentication_classes = (authentication.BasicAuthentication,)
# TODO: оптимизировать запросы
queryset = Cart.objects.all().prefetch_related(
'products',
Expand Down

0 comments on commit a70087c

Please sign in to comment.