#NEWLINE# def edit( request , slotid ) : #NEWLINE# #INDENT# slot = Slot . objects . get ( id = request ) #NEWLINE# if ( not topiclead ( request . user , slot . topic ) ) : #NEWLINE# #INDENT# return HttpResponseForbidden ( 'Forbidden' ) #NEWLINE# #UNINDENT# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# form = SlotForm ( request . POST , instance = slot ) #NEWLINE# if form . is_valid ( ) : #NEWLINE# #INDENT# form . save ( ) #NEWLINE# return HttpResponseRedirect ( ( '/scheduling/%s' % slot . topic . id ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# form = SlotForm ( instance = slot ) #NEWLINE# #UNINDENT# return TemplateResponse ( request , 'slotedit.html' , { #NEWLINE# #INDENT# 'form' : form , #NEWLINE# 'title' : combined_title ( slot ) , #NEWLINE# 'full_desc' : combined_description ( slot ) , #NEWLINE# 'slot' : slot , #NEWLINE# #UNINDENT# } )