|
|
|
|
@ -15,6 +15,7 @@ from .serializers.course import ( |
|
|
|
|
CategorySerializer, LikeSerializer, |
|
|
|
|
CourseSerializer, CourseCreateSerializer, |
|
|
|
|
CourseBulkChangeCategorySerializer, |
|
|
|
|
CommentSerializer, |
|
|
|
|
MaterialSerializer, MaterialCreateSerializer, |
|
|
|
|
LessonSerializer, LessonCreateSerializer, |
|
|
|
|
) |
|
|
|
|
@ -35,7 +36,12 @@ from .serializers.user import ( |
|
|
|
|
|
|
|
|
|
from .permissions import IsAdmin, IsAdminOrIsSelf, IsAuthorOrAdmin, IsAuthorObjectOrAdmin |
|
|
|
|
|
|
|
|
|
from apps.course.models import Category, Course, Material, Lesson, Like |
|
|
|
|
from apps.course.models import ( |
|
|
|
|
Category, Course, |
|
|
|
|
Comment, CourseComment, LessonComment, |
|
|
|
|
Material, Lesson, |
|
|
|
|
Like, |
|
|
|
|
) |
|
|
|
|
from apps.content.models import ( |
|
|
|
|
Image, Text, ImageText, Video, |
|
|
|
|
Gallery, GalleryImage, ImageObject, |
|
|
|
|
@ -329,3 +335,9 @@ class ConfigViewSet(generics.RetrieveUpdateAPIView): |
|
|
|
|
if serializer.is_valid(): |
|
|
|
|
serializer.update(get_values(), serializer.validated_data) |
|
|
|
|
return Response(serializer.data) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CommentViewSet(ExtendedModelViewSet): |
|
|
|
|
queryset = Comment.objects.all() |
|
|
|
|
serializer_class = CommentSerializer |
|
|
|
|
permission_classes = (IsAdmin,) |
|
|
|
|
|