Skip to content

Commit

Permalink
feat!: upgrading api to DRF.
Browse files Browse the repository at this point in the history
  • Loading branch information
awais786 committed Oct 6, 2024
1 parent 91c3477 commit 4b7a11b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lms/djangoapps/instructor/tests/test_certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)})
Expand All @@ -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')
Expand Down
5 changes: 2 additions & 3 deletions lms/djangoapps/instructor/views/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
)

Expand Down

0 comments on commit 4b7a11b

Please sign in to comment.