Guest User

Untitled

a guest
Mar 19th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. from tropicalista.models.account.real_account import AccountDetails
  2. from tropicalista.models import DBSession
  3. import transaction
  4.  
  5. borrowers = borrower.query.all()
  6. for b in borrowers:
  7. acc = AccountDetails.create_or_get_account(b,
  8. b.real_account_bank,
  9. b.real_account_bank_branch,
  10. b.real_account_number)
  11.  
  12. payment_method = b.registration_current_loan.payment_method
  13.  
  14. if payment_method.payment_method == 'payment_method_dai':
  15. acc.active = True
  16.  
  17. DBSession.add(acc)
  18. DBSession.flush()
  19.  
  20. transaction.commit()
Add Comment
Please, Sign In to add comment