@handle_dashboard_error
@require_POST
@ensure_csrf_cookie
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
@require_level('staff')
@require_post_params('student', 'url', 'due_datetime')
def change_due_date(request, course_id):
 course = get_course_by_id(SlashSeparatedCourseKey.from_deprecated_string(course_id))
 student = require_student_from_identifier(request.POST.get('student'))
 unit = find_unit(course, request.POST.get('url'))
 due_date = parse_datetime(request.POST.get('due_datetime'))
 set_due_date_extension(course, unit, student, due_date)
 return JsonResponse(_('Successfully changed due date for student {0} for {1} to {2}').format(student.profile.name, _display_unit(unit), due_date.strftime('%Y-%m-%d %H:%M')))

@ handle_dashboard_error @ require_POST @ ensure_csrf_cookie @ cache_control ( no_cache = True , no_store = True , must_revalidate = True ) @ require_level ( 'staff' ) @ require_post_params ( 'student' , 'url' , 'due_datetime' ) def change_due_date ( request , course_id ) : course = get_course_by_id ( SlashSeparatedCourseKey . from_deprecated_string ( course_id ) ) student = require_student_from_identifier ( request . POST . get ( 'student' ) ) unit = find_unit ( course , request . POST . get ( 'url' ) ) due_date = parse_datetime ( request . POST . get ( 'due_datetime' ) ) set_due_date_extension ( course , unit , student , due_date ) return JsonResponse ( _ ( 'Successfully changed due date for student {0} for {1} to {2}' ) . format ( student . profile . name , _display_unit ( unit ) , due_date . strftime ( '%Y-%m-%d %H:%M' ) ) )
grants a due date extension to a student for a particular unit .