#NEWLINE# @ login_required #NEWLINE# def sponsor_apply( request ) : #NEWLINE# #INDENT# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# form = SponsorApplicationForm ( request . POST , user = request . user ) #NEWLINE# if form . is_valid ( ) : #NEWLINE# #INDENT# sponsor = form . save ( ) #NEWLINE# if sponsor . sponsor_benefits . all ( ) : #NEWLINE# #INDENT# messages . success ( request , _ ( 'Thank you for your sponsorship application. Please update your benefit details below.' ) ) #NEWLINE# return redirect ( 'sponsor_detail' , pk = sponsor . pk ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# messages . success ( request , _ ( 'Thank you for your sponsorship application.' ) ) #NEWLINE# return redirect ( 'dashboard' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# form = SponsorApplicationForm ( user = request . user ) #NEWLINE# #UNINDENT# return render_to_response ( 'symposion/sponsorship/apply.html' , { #NEWLINE# #INDENT# 'form' : form , #NEWLINE# #UNINDENT# } , context_instance = RequestContext ( request ) )