def ccx_invite(request, course, ccx=None): """ Invite users to new ccx """ if not ccx: raise Http404 action = request.POST.get('enrollment-button') identifiers_raw = request.POST.get('student-ids') identifiers = _split_input_list(identifiers_raw) email_students = 'email-students' in request.POST course_key = CCXLocator.from_course_locator(course.id, unicode(ccx.id)) email_params = get_email_params(course, auto_enroll=True, course_key=course_key, display_name=ccx.display_name) ccx_students_enrolling_center(action, identifiers, email_students, course_key, email_params, ccx.coach) url = reverse('ccx_coach_dashboard', kwargs={'course_id': course_key}) return redirect(url)
def ccx_invite(request, course, ccx=None): """ Invite users to new ccx """ if not ccx: raise Http404 action = request.POST.get('enrollment-button') identifiers_raw = request.POST.get('student-ids') identifiers = _split_input_list(identifiers_raw) email_students = 'email-students' in request.POST course_key = CCXLocator.from_course_locator(course.id, unicode(ccx.id)) email_params = get_email_params(course, auto_enroll=True, course_key=course_key, display_name=ccx.display_name) ccx_students_enrolling_center(action, identifiers, email_students, course_key, email_params, ccx.coach) url = reverse('ccx_coach_dashboard', kwargs={'course_id': course_key}) return redirect(url)
def get_enrollment_action_and_identifiers(request): """ Extracts action type and student identifiers from the request on Enrollment tab of CCX Dashboard. """ action, identifiers = None, None student_action = request.POST.get('student-action', None) batch_action = request.POST.get('enrollment-button', None) if student_action: action = student_action student_id = request.POST.get('student-id', '') identifiers = [student_id] elif batch_action: action = batch_action identifiers_raw = request.POST.get('student-ids') identifiers = _split_input_list(identifiers_raw) return action, identifiers
def get_enrollment_action_and_identifiers(request): """ Extracts action type and student identifiers from the request on Enrollment tab of CCX Dashboard. """ action, identifiers = None, None student_action = request.POST.get('student-action', None) batch_action = request.POST.get('enrollment-button', None) if student_action: action = student_action student_id = request.POST.get('student-id', '') identifiers = [student_id] elif batch_action: action = batch_action identifiers_raw = request.POST.get('student-ids') identifiers = _split_input_list(identifiers_raw) return action, identifiers