#NEWLINE# @ accounts . route ( '/account/transfer/delete/<transfer_id>' ) #NEWLINE# @ login_required #NEWLINE# def delete_transfer( transfer_id ) : #NEWLINE# #INDENT# 'Delete account transfer' #NEWLINE# current_user_id = session . get ( 'logged_in_user' ) #NEWLINE# accounts = Accounts ( current_user_id ) #NEWLINE# transfer = accounts . get_transfer ( transfer_id ) #NEWLINE# if transfer : #NEWLINE# #INDENT# accounts . modify_account_balance ( transfer . from_account , transfer . amount ) #NEWLINE# accounts . modify_account_balance ( transfer . to_account , ( - float ( transfer . amount ) ) ) #NEWLINE# accounts . delete_transfer ( transfer_id ) #NEWLINE# flash ( 'Transfer deleted' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# flash ( 'Not a valid account transfer' , 'error' ) #NEWLINE# #UNINDENT# return redirect ( url_for ( 'accounts.show_transfers' ) )