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 Sep 24, 2024
1 parent ee6045c commit 4c3f224
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lms/djangoapps/instructor/tests/test_certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ def test_missing_username_and_email_error(self):
res_json = json.loads(response.content.decode('utf-8'))

# Assert Error Message
assert res_json['errors'] == {'user': ['This field may not be blank.']}
assert res_json['message'] == {'user': ['This field may not be blank.']}

def test_invalid_user_name_error(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/instructor/views/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3640,7 +3640,7 @@ def post(self, request, course_id):
serializer_data = self.serializer_class(data=request.data)
if not serializer_data.is_valid():
# return HttpResponseBadRequest(reason=serializer_data.errors)
return JsonResponse({'errors': serializer_data.errors}, status=400)
return JsonResponse({'message': serializer_data.errors}, status=400)

student = serializer_data.validated_data.get('user')
notes = serializer_data.validated_data.get('notes')
Expand Down

0 comments on commit 4c3f224

Please sign in to comment.