#NEWLINE# @ loans . route ( '/loans/edit/<loan_id>' , methods = [ 'GET' , 'POST' ] ) #NEWLINE# @ login_required #NEWLINE# def edit_loan( loan_id ) : #NEWLINE# #INDENT# 'Edit loan entry' #NEWLINE# current_user_id = session . get ( 'logged_in_user' ) #NEWLINE# our_loans = Loans ( loan_id ) #NEWLINE# loan = our_loans . get_loan ( loan_id ) #NEWLINE# if loan : #NEWLINE# #INDENT# if ( float ( loan . amount ) > 0 ) : #NEWLINE# #INDENT# return __edit_get_loan ( ** locals ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# loan . amount = abs ( loan . amount ) #NEWLINE# return __edit_give_loan ( ** locals ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return redirect ( url_for ( 'loans.index' ) )