From 4b7a11b6d10a4770cd62288b13290e125809addc Mon Sep 17 00:00:00 2001 From: awais qureshi Date: Mon, 7 Oct 2024 00:33:44 +0500 Subject: [PATCH] feat!: upgrading api to DRF. --- lms/djangoapps/instructor/tests/test_certificates.py | 4 ++-- lms/djangoapps/instructor/views/api.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lms/djangoapps/instructor/tests/test_certificates.py b/lms/djangoapps/instructor/tests/test_certificates.py index 7acaf002fe21..fc3c7c2db249 100644 --- a/lms/djangoapps/instructor/tests/test_certificates.py +++ b/lms/djangoapps/instructor/tests/test_certificates.py @@ -367,7 +367,7 @@ def test_certificate_regeneration_error(self): # Assert Error Message assert res_json['message'] ==\ - 'Please select one or more certificate statuses that require certificate regeneration.' + 'Please select certificate statuses from the list only.' # Access the url passing 'certificate_statuses' that are not present in db url = reverse('start_certificate_regeneration', kwargs={'course_id': str(self.course.id)}) @@ -379,7 +379,7 @@ def test_certificate_regeneration_error(self): # Assert Error Message assert (res_json['message'] == - 'Please select one or more certificate statuses that require certificate regeneration.') + 'Please select certificate statuses from the list only.') @override_settings(CERT_QUEUE='certificates') diff --git a/lms/djangoapps/instructor/views/api.py b/lms/djangoapps/instructor/views/api.py index 8f88f45270c9..3c7302f3741b 100644 --- a/lms/djangoapps/instructor/views/api.py +++ b/lms/djangoapps/instructor/views/api.py @@ -76,7 +76,7 @@ from common.djangoapps.util.json_request import JsonResponse, JsonResponseBadRequest from common.djangoapps.util.views import require_global_staff # pylint: disable=unused-import from lms.djangoapps.bulk_email.api import is_bulk_email_feature_enabled, create_course_email -from lms.djangoapps.certificates import api as certs_api +from lms.djangoapps.certificates import api as certs_api from lms.djangoapps.course_home_api.toggles import course_home_mfe_progress_tab_is_active from lms.djangoapps.courseware.access import has_access from lms.djangoapps.courseware.courses import get_course_with_access @@ -3287,8 +3287,7 @@ def post(self, request, course_id): if not serializer.is_valid(): return JsonResponse( - {'message': _('Please select one or more certificate statuses that ' - 'require certificate regeneration.')}, + {'message': _('Please select certificate statuses from the list only.')}, status=400 )