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: [AXIMST-166] Certificates screen additional data #2499

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ class CourseCertificatesSerializer(serializers.Serializer):
mfe_proctored_exam_settings_url = serializers.CharField(
required=False, allow_null=True, allow_blank=True
)
course_number = serializers.CharField(source="context_course.number")
course_title = serializers.CharField(source="context_course.display_name_with_default")
course_number_override = serializers.CharField(source="context_course.display_coursenumber")
59 changes: 31 additions & 28 deletions cms/djangoapps/contentstore/rest_api/v1/views/certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,35 +58,38 @@ def get(self, request: Request, course_id: str):

```json
{
"certificate_activation_handler_url": "/certificates/activation/course-v1:org+101+101/",
"certificate_web_view_url": "///certificates/course/course-v1:org+101+101?preview=honor",
"certificates": [
{
"course_title": "Course title",
"description": "Description of the certificate",
"editing": false,
"id": 1622146085,
"is_active": false,
"name": "Name of the certificate",
"signatories": [
"certificate_activation_handler_url": "/certificates/activation/course-v1:org+101+101/",
"certificate_web_view_url": "///certificates/course/course-v1:org+101+101?preview=honor",
"certificates": [
{
"id": 268550145,
"name": "name_sign",
"organization": "org",
"signature_image_path": "/asset-v1:org+101+101+type@[email protected]",
"title": "title_sign"
}
],
"version": 1
}
],
"course_modes": [
"honor"
],
"has_certificate_modes": true,
"is_active": false,
"is_global_staff": true,
"mfe_proctored_exam_settings_url": ""
"course_title": "Course title",
"description": "Description of the certificate",
"editing": false,
"id": 1622146085,
"is_active": false,
"name": "Name of the certificate",
"signatories": [
{
"id": 268550145,
"name": "name_sign",
"organization": "org",
"signature_image_path": "/asset-v1:org+101+101+type@[email protected]",
"title": "title_sign"
}
],
"version": 1
},
],
"course_modes": [
"honor"
],
"has_certificate_modes": true,
"is_active": false,
"is_global_staff": true,
"mfe_proctored_exam_settings_url": "",
"course_number": "DemoX",
"course_title": "Demonstration Course",
"course_number_override": "Course Number Display String"
}
```
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ def test_success_response(self):
"""
self._add_course_certificates(count=2, signatory_count=2)
response = self.client.get(self.url)
response_data = response.data
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(len(response.data["certificates"]), 2)
self.assertEqual(len(response.data["certificates"][0]["signatories"]), 2)
self.assertEqual(len(response.data["certificates"][1]["signatories"]), 2)
self.assertEqual(len(response_data["certificates"]), 2)
self.assertEqual(len(response_data["certificates"][0]["signatories"]), 2)
self.assertEqual(len(response_data["certificates"][1]["signatories"]), 2)
self.assertEqual(response_data["course_number_override"], self.course.display_coursenumber)
self.assertEqual(response_data["course_title"], self.course.display_name_with_default)
self.assertEqual(response_data["course_number"], self.course.number)
Loading