#NEWLINE# @ mod . route ( '/threads/vote/' , methods = [ 'POST' ] ) #NEWLINE# @ requires_login #NEWLINE# def vote_thread( ) : #NEWLINE# #INDENT# '\n    Submit votes via ajax\n    ' #NEWLINE# thread_id = int ( request . form [ 'thread_id' ] ) #NEWLINE# user_id = g . user . id #NEWLINE# if ( not thread_id ) : #NEWLINE# #INDENT# abort ( 404 ) #NEWLINE# #UNINDENT# thread = Thread . query . get_or_404 ( int ( thread_id ) ) #NEWLINE# vote_status = thread . vote ( user_id = user_id ) #NEWLINE# return jsonify ( new_votes = thread . votes , vote_status = thread_id )