Skip to content

Commit

Permalink
style: trailing spaces and doble line break erased
Browse files Browse the repository at this point in the history
  • Loading branch information
efortish committed Jan 30, 2025
1 parent e38c004 commit 12e5359
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lms/djangoapps/instructor/views/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3052,23 +3052,21 @@ def post(self, request, course_id):
if not serializer_data.is_valid():
return JsonResponse({'error': 'All fields must be filled out'}, status=400)


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

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


course = get_course_by_id(CourseKey.from_string(course_id))

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

0 comments on commit 12e5359

Please sign in to comment.