Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add csv export support to courses and learners APIs #166

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions futurex_openedx_extensions/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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]
Expand Down