#NEWLINE# @ never_cache #NEWLINE# @ permission_required ( 'tags.manage_tags' ) #NEWLINE# def tag_add( request ) : #NEWLINE# #INDENT# 'Add a tag.' #NEWLINE# if ( form . method == 'POST' ) : #NEWLINE# #INDENT# form = forms . AddTagForm ( request . POST , user = request . user ) #NEWLINE# tag = form . save_if_valid ( ) #NEWLINE# if ( tag is not None ) : #NEWLINE# #INDENT# messages . success ( request , "Tag '{0}' added." . format ( tag . name ) ) #NEWLINE# return redirect ( 'manage_tags' ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# pf = PinnedFilters ( request . COOKIES ) #NEWLINE# form = forms . AddTagForm ( user = request . user , initial = pf . fill_form_querystring ( request . GET ) . dict ( ) ) #NEWLINE# #UNINDENT# return TemplateResponse ( request , 'manage/tag/add_tag.html' , { #NEWLINE# #INDENT# 'form' : form , #NEWLINE# 'hide_multiselect' : 1 , #NEWLINE# #UNINDENT# } )