diff --git a/futurex_openedx_extensions/dashboard/serializers.py b/futurex_openedx_extensions/dashboard/serializers.py index c4197606..3dd33950 100644 --- a/futurex_openedx_extensions/dashboard/serializers.py +++ b/futurex_openedx_extensions/dashboard/serializers.py @@ -233,7 +233,7 @@ def get_enrolled_courses_count(self, obj: get_user_model) -> Any: # pylint: dis class LearnerDetailsForCourseSerializer(LearnerBasicDetailsSerializer): """Serializer for learner details for a course.""" certificate_available = serializers.BooleanField() - course_score = serializers.DecimalField(max_digits=5, decimal_places=2) + course_score = serializers.FloatField() active_in_course = serializers.BooleanField() progress = SerializerOptionalMethodField(field_tags=['progress', 'csv_export']) certificate_url = SerializerOptionalMethodField(field_tags=['certificate_url', 'csv_export']) diff --git a/futurex_openedx_extensions/helpers/admin.py b/futurex_openedx_extensions/helpers/admin.py index e08391a9..573fca11 100644 --- a/futurex_openedx_extensions/helpers/admin.py +++ b/futurex_openedx_extensions/helpers/admin.py @@ -139,6 +139,7 @@ def invalidate_cache(self, request: Any, cache_name: str) -> HttpResponseRedirec class DataExportTaskAdmin(admin.ModelAdmin): """Admin class of DataExportTask model""" + raw_id_fields = ('user', 'tenant') list_display = ('id', 'view_name', 'status', 'progress', 'user', 'notes',) search_fields = ('filename', 'user__email', 'user__username', 'notes') diff --git a/tests/test_dashboard/test_serializers.py b/tests/test_dashboard/test_serializers.py index 4b1f3748..eb838ecf 100644 --- a/tests/test_dashboard/test_serializers.py +++ b/tests/test_dashboard/test_serializers.py @@ -263,7 +263,7 @@ def test_learner_details_for_course_serializer(mock_collect, base_data,): # pyl data = serializer.data assert len(data) == 1 assert data[0]['certificate_available'] is True - assert data[0]['course_score'] == '0.67' + assert data[0]['course_score'] == 0.67 assert data[0]['active_in_course'] is True