Skip to content

Commit

Permalink
Merge pull request #166 from nelc/shadinaif/activate-download-csv
Browse files Browse the repository at this point in the history
feat: add csv export support to courses and learners APIs
  • Loading branch information
shadinaif authored Dec 16, 2024
2 parents 94723c4 + 35af037 commit 1047b6d
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 1047b6d

Please sign in to comment.