Skip to content

Commit

Permalink
Merge pull request #149 from nelc/tehreem/fix_issues_114_and_148
Browse files Browse the repository at this point in the history
fix: issue 114 for data export django admin and 147 for course score in course learners api
  • Loading branch information
tehreem-sadat authored Nov 21, 2024
2 parents f4103ef + efb019e commit 247d87f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion futurex_openedx_extensions/dashboard/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
1 change: 1 addition & 0 deletions futurex_openedx_extensions/helpers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
2 changes: 1 addition & 1 deletion tests/test_dashboard/test_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 247d87f

Please sign in to comment.