@ensure_csrf_cookie
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
@require_level('staff')
@require_POST
def mark_student_can_skip_entrance_exam(request, course_id):
 course_id = SlashSeparatedCourseKey.from_deprecated_string(course_id)
 student_identifier = request.POST.get('unique_student_identifier')
 student = get_student_from_identifier(student_identifier)
 (__, created) = EntranceExamConfiguration.objects.get_or_create(user=student, course_id=course_id)
 if created:
  message = (_('This student (%s) will skip the entrance exam.') % student_identifier)
 else:
  message = (_('This student (%s) is already allowed to skip the entrance exam.') % student_identifier)
 response_payload = {'message': message}
 return JsonResponse(response_payload)

@ ensure_csrf_cookie @ cache_control ( no_cache = True , no_store = True , must_revalidate = True ) @ require_level ( 'staff' ) @ require_POST def mark_student_can_skip_entrance_exam ( request , course_id ) : course_id = SlashSeparatedCourseKey . from_deprecated_string ( course_id ) student_identifier = request . POST . get ( 'unique_student_identifier' ) student = get_student_from_identifier ( student_identifier ) ( __ , created ) = EntranceExamConfiguration . objects . get_or_create ( user = student , course_id = course_id ) if created : message = ( _ ( 'This student (%s) will skip the entrance exam.' ) % student_identifier ) else : message = ( _ ( 'This student (%s) is already allowed to skip the entrance exam.' ) % student_identifier ) response_payload = { 'message' : message } return JsonResponse ( response_payload )
mark a student to skip entrance exam .