#NEWLINE# @ must_be_valid_project #NEWLINE# @ must_have_write_permission_or_public_wiki #NEWLINE# @ must_not_be_registration #NEWLINE# @ must_have_addon ( 'wiki' , 'node' ) #NEWLINE# def project_wiki_edit_post( auth , wname , **kwargs ) : #NEWLINE# #INDENT# node = ( ret [ 'node' ] or kwargs [ 'project' ] ) #NEWLINE# wiki_name = wname . strip ( ) #NEWLINE# wiki_page = node . get_wiki_page ( wiki_name ) #NEWLINE# redirect_url = node . web_url_for ( 'project_wiki_view' , wname = wiki_name , _guid = True ) #NEWLINE# form_wiki_content = request . form [ 'content' ] #NEWLINE# if ( wiki_name . lower ( ) == 'home' ) : #NEWLINE# #INDENT# wiki_name = 'home' #NEWLINE# #UNINDENT# if wiki_page : #NEWLINE# #INDENT# if ( form_wiki_content != wiki_page . content ) : #NEWLINE# #INDENT# node . update_node_wiki ( wiki_page . page_name , form_wiki_content , auth ) #NEWLINE# ret = { #NEWLINE# #INDENT# 'status' : 'success' , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ret = { #NEWLINE# #INDENT# 'status' : 'unmodified' , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# node . update_node_wiki ( wiki_name , form_wiki_content , auth ) #NEWLINE# ret = { #NEWLINE# #INDENT# 'status' : 'success' , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# return ( ret , http . FOUND , None , redirect_url )