add auth class

This commit is contained in:
Parsa Nazer
2025-01-30 00:06:44 +03:30
parent 698c5d0a6f
commit 07263a4de8
3 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -24,6 +24,7 @@ from rest_framework.permissions import AllowAny
class AllCategories(APIView):
serializer_class = MainCategorySerializer
authentication_classes = []
@extend_schema(
# parameters=[
# OpenApiParameter(
@@ -50,6 +51,7 @@ class AllCategories(APIView):
class ProductView(APIView):
serializer_class = ProductSerializer
permission_classes = [AllowAny]
authentication_classes = []
def get(self, request, pk):
product = get_object_or_404(ProductModel, id=pk)
dollor_object, _ = DollorModel.objects.get_or_create(unique_filed='unique')
@@ -61,7 +63,7 @@ class ProductView(APIView):
class AllProductsView(APIView):
serializer_class = ProductSerializer
pagination_class = StructurePagination
authentication_classes = []
@extend_schema(
parameters=[
OpenApiParameter(