#NEWLINE# @ login_required ( login_url = '/landpage' ) #NEWLINE# def course_modal( request ) : #NEWLINE# #INDENT# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# course_id = int ( request . POST [ 'course_id' ] ) #NEWLINE# form = None #NEWLINE# course = None #NEWLINE# if ( course_id > 0 ) : #NEWLINE# #INDENT# course = Course . objects . get ( id = course_id ) #NEWLINE# form = CourseForm ( instance = course ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# form = CourseForm ( ) #NEWLINE# #UNINDENT# return render ( request , 'registrar/teaching/new_course_modal.html' , { #NEWLINE# #INDENT# 'course' : course , #NEWLINE# 'course_form' : form , #NEWLINE# #UNINDENT# } )