From 35af037a4b55e35624c59731c62d161e9931ef28 Mon Sep 17 00:00:00 2001 From: Shadi Naif Date: Sun, 15 Dec 2024 16:34:30 +0300 Subject: [PATCH] feat: add csv export support to courses and learners APIs --- futurex_openedx_extensions/dashboard/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/futurex_openedx_extensions/dashboard/views.py b/futurex_openedx_extensions/dashboard/views.py index 412d1c7..9cff492 100644 --- a/futurex_openedx_extensions/dashboard/views.py +++ b/futurex_openedx_extensions/dashboard/views.py @@ -184,7 +184,7 @@ def get(self, request: Any, *args: Any, **kwargs: Any) -> Response | JsonRespons return JsonResponse(result) -class LearnersView(FXViewRoleInfoMixin, ListAPIView): +class LearnersView(ExportCSVMixin, FXViewRoleInfoMixin, ListAPIView): """View to get the list of learners""" authentication_classes = default_auth_classes permission_classes = [FXHasTenantCourseAccess] @@ -206,7 +206,7 @@ def get_queryset(self) -> QuerySet: ) -class CoursesView(FXViewRoleInfoMixin, ListAPIView): +class CoursesView(ExportCSVMixin, FXViewRoleInfoMixin, ListAPIView): """View to get the list of courses""" authentication_classes = default_auth_classes permission_classes = [FXHasTenantCourseAccess] @@ -443,7 +443,7 @@ def get_serializer_context(self) -> Dict[str, Any]: return context -class LearnersEnrollmentView(FXViewRoleInfoMixin, ListAPIView): +class LearnersEnrollmentView(ExportCSVMixin, FXViewRoleInfoMixin, ListAPIView): """View to get the list of learners for a course""" serializer_class = serializers.LearnerEnrollmentSerializer permission_classes = [FXHasTenantCourseAccess]