Skip to content

Commit

Permalink
feat: add translation markers to text strings
Browse files Browse the repository at this point in the history
  • Loading branch information
efortish committed Feb 19, 2025
1 parent 6cdb8af commit 546e4c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lms/djangoapps/instructor/views/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3050,20 +3050,20 @@ def post(self, request, course_id):
"""
serializer_data = self.serializer_class(data=request.data)
if not serializer_data.is_valid():
return JsonResponseBadRequest({'error': 'All fields must be filled out'})
return JsonResponseBadRequest({'error': _('All fields must be filled out')})

student = serializer_data.validated_data.get('student')
if not student:
response_payload = {
'error': f'Could not find student matching identifier: {request.data.get("student")}'
}
'error': _('Could not find student matching identifier: {student}').format(student=request.data.get("student"))
}
return JsonResponse(response_payload, status=status.HTTP_404_NOT_FOUND)

due_datetime = serializer_data.validated_data.get('due_datetime')
try:
due_date = parse_datetime(due_datetime)
except DashboardError:
return JsonResponseBadRequest({'error': 'The extension due date and time format is incorrect'})
return JsonResponseBadRequest({'error': _('The extension due date and time format is incorrect')})

course = get_course_by_id(CourseKey.from_string(course_id))
unit = find_unit(course, serializer_data.validated_data.get('url'))
Expand Down

0 comments on commit 546e4c6

Please sign in to comment.