#NEWLINE# def flag( request , comment_id , next = None ) : #NEWLINE# #INDENT# '\n    Flags a comment. Confirmation on GET, action on POST.\n\n    Templates: `comments/flag.html`,\n    Context:\n        comment\n            the flagged `comments.comment` object\n    ' #NEWLINE# comment = get_object_or_404 ( comments . get_model ( ) , pk = comment_id , site__pk = settings . SITE_ID ) #NEWLINE# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# ( flag , created ) = comments . models . CommentFlag . objects . get_or_create ( comment = comment , user = request . user , flag = comments . models . CommentFlag . SUGGEST_REMOVAL ) #NEWLINE# signals . comment_was_flagged . send ( sender = comment . __class__ , comment = comment , flag = flag , created = created , request = request ) #NEWLINE# return next_redirect ( request . POST . copy ( ) , next , flag_done , c = comment . pk ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return render_to_response ( 'comments/flag.html' , { #NEWLINE# #INDENT# 'comment' : comment , #NEWLINE# 'next' : next , #NEWLINE# #UNINDENT# } , template . RequestContext ( request ) )