#NEWLINE# @ csrf_exempt #NEWLINE# def other_perms_view( request , permission , user , target , redirect_to = None ) : #NEWLINE# #INDENT# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# give_permission_to ( user , permission , target ) #NEWLINE# redirect_to = ( redirect_to or reverse ( 'test_view_crud' ) ) #NEWLINE# return HttpResponseRedirect ( redirect_to ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return HttpResponse ( ( '\nDo you want to get %s permission for obj %s?\n<form action="" method="POST">\n<input type="submit" value="Yes" />\n<input type="button" value="No" onclick="document.location=\'%s\'" />\n</form>\n' % ( permission . name , target , reverse ( 'test_view_crud' ) ) ) )