#NEWLINE# @ login_required #NEWLINE# @ permission_required ( 'waitinglist.manage_cohorts' ) #NEWLINE# def cohort_create( request ) : #NEWLINE# #INDENT# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# form = CohortCreate ( request . POST ) #NEWLINE# if form . is_valid ( ) : #NEWLINE# #INDENT# cohort = form . save ( ) #NEWLINE# return redirect ( 'waitinglist_cohort_detail' , request . id ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# form = CohortCreate ( ) #NEWLINE# #UNINDENT# ctx = { #NEWLINE# #INDENT# 'form' : form , #NEWLINE# #UNINDENT# } #NEWLINE# return render ( request , 'cohorts/cohort_create.html' , ctx )