AllowAny permsion class

This commit is contained in:
Parsa Nazer
2025-01-14 18:56:23 +03:30
parent 03adf2e284
commit b199d53ea6
+2 -1
View File
@@ -10,7 +10,7 @@ from rest_framework.permissions import IsAuthenticatedOrReadOnly
from utils.pagination import StructurePagination
from drf_spectacular.utils import extend_schema, OpenApiParameter
from drf_spectacular.types import OpenApiTypes
from rest_framework.permission_classes import AllowAny
class AllCategories(APIView):
serializer_class = CategorySerializer
@@ -21,6 +21,7 @@ class AllCategories(APIView):
class ProductView(APIView):
serializer_class = ProductSerializer
permission_classes = AllowAny
def get(self, request, pk):
product = get_object_or_404(ProductModel, id=pk)
product_ser = self.serializer_class(instance=product, many=False)