#NEWLINE# def user_unsubscribe( request , nickname ) : #NEWLINE# #INDENT# 'Unsubscribe to a user.\n\n    Authentication is required.\n    ' #NEWLINE# if ( not ( request . method == 'POST' ) ) : #NEWLINE# #INDENT# return HttpResponseRedirect ( reverse ( 'user' , args = [ nickname ] ) ) #NEWLINE# #UNINDENT# if ( not request . session . get ( 'nickname' , None ) ) : #NEWLINE# #INDENT# return HttpResponseRedirect ( reverse ( 'login' ) ) #NEWLINE# #UNINDENT# f = friendfeed . FriendFeed ( data . session [ 'nickname' ] , request . session [ 'key' ] ) #NEWLINE# data = f . user_unsubscribe ( nickname ) #NEWLINE# if ( 'errorCode' in data ) : #NEWLINE# #INDENT# return error ( request , data ) #NEWLINE# #UNINDENT# memcache . delete ( ( 'profile/' + request . session [ 'nickname' ] ) ) #NEWLINE# args = { #NEWLINE# #INDENT# 'message' : data . get ( 'status' , '' ) , #NEWLINE# #UNINDENT# } #NEWLINE# return HttpResponseRedirect ( ( ( reverse ( 'user' , args = [ nickname ] ) + '?' ) + urllib . urlencode ( args ) ) )