Commit ef2beb5e authored by Glaucia S. Santos's avatar Glaucia S. Santos

Update endpoint

parent 46c6e8b0
......@@ -11,7 +11,7 @@ class CourseMaterialViewSet(viewsets.ModelViewSet):
serializer_class = CourseMaterialSerializer
permission_classes = (IsAuthenticated,)
lookup_field = 'course'
filter_fields = ('course__id',)
filter_fields = ('course__id', 'course__slug')
def pre_save(self, obj):
# Get Question vote usign kwarg as questionId
......@@ -21,7 +21,7 @@ class CourseMaterialViewSet(viewsets.ModelViewSet):
return super(CourseMaterialViewSet, self).pre_save(obj)
class CourseMaterialFileViewSet(mixins.DestroyModelMixin, viewsets.GenericViewSet):
class CourseMaterialFileViewSet(viewsets.ModelViewSet):
model = CourseMaterialFile
queryset = CourseMaterialFile.objects.all()
serializer_class = FilesSerializer
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment