#NEWLINE# @ requires_admin #NEWLINE# def edit_comment( request ) : #NEWLINE# #INDENT# comment = _get_item ( form ) #NEWLINE# form = CommentForm ( instance = comment ) #NEWLINE# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# if request . POST . get ( 'delete' ) : #NEWLINE# #INDENT# comment . delete ( ) #NEWLINE# article_url = request . REQUEST . get ( 'article_url' ) #NEWLINE# if ( article_url . find ( '#' ) == ( - 1 ) ) : #NEWLINE# #INDENT# article_url += '#comments' #NEWLINE# #UNINDENT# return HttpResponseRedirect ( article_url ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# form = CommentForm ( request . POST , instance = comment ) #NEWLINE# if form . is_valid ( ) : #NEWLINE# #INDENT# form . save ( ) #NEWLINE# return _render ( request , 'frontend/admin/edit.html' , { #NEWLINE# #INDENT# 'form' : form , #NEWLINE# 'comment' : comment , #NEWLINE# 'message' : 'Message saved!' , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return _render ( request , 'frontend/admin/edit.html' , { #NEWLINE# #INDENT# 'form' : form , #NEWLINE# 'comment' : comment , #NEWLINE# #UNINDENT# } )