#NEWLINE# @ expenses . route ( '/expense/category/add' , methods = [ 'GET' , 'POST' ] ) #NEWLINE# @ login_required #NEWLINE# def add_category( ) : #NEWLINE# #INDENT# 'Add an expense category' #NEWLINE# error = None #NEWLINE# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# ( new_category_name , current_user_id ) = ( request . form [ 'name' ] , session . get ( 'logged_in_user' ) ) #NEWLINE# exp = Expenses ( current_user_id ) #NEWLINE# error = entries . add_category ( exp , new_category_name ) #NEWLINE# if ( not error ) : #NEWLINE# #INDENT# flash ( 'Expense category added' ) #NEWLINE# #UNINDENT# #UNINDENT# return render_template ( 'admin_add_expense_category.html' , error = error )