"""This module holds the V2 api-related views for the ``assessments`` app"""

from rest_framework.generics import CreateAPIView

from rest_framework.permissions import IsAdminUser

from .serializers import LessonReferenceSerializer


class LessonReferenceCreateView(CreateAPIView):
    """API View to create ``LessonReference``s"""

    permission_classes = (IsAdminUser,)
    serializer_class = LessonReferenceSerializer

    def get_serializer(self, *args, **kwargs):
        """Override the ``get_serializer`` adding the "many" argument

        For the parameters, see ``django_rest.generics.CreateAPIView``

        """

        return super().get_serializer(*args, many=True, **kwargs)
