Files
www.gittip.com/www/bank-account-complete.html
Chad Whitacre 28cb48c72a Big changeover from id to username; #287
I sort of did this one with the blast shield down. I haven't even run
the tests yet. The sorts of things I changed:

 - SQL {elsewhere,exchanges}.participant_id => .participant
 - SQL participants.id => .username
 - ORM {user,participant,self}.id => .username
2013-04-05 15:48:59 -04:00

31 lines
966 B
HTML

"""Used when a person needed to go to Balanced to verify their merchant details
they are redirected here after the fact.
"""
from aspen import Response
from gittip import billing
#=========================================================================== ^L
if user.ANON:
raise Response(404)
request.allow('GET')
# no validation here, if any of this stuff errors out, it's because someone has
# done something dodgy (or we f'd up)
assert user.balanced_account_uri is not None, user.username
account = billing.get_balanced_account( user.username
, user.balanced_account_uri
)
account.merchant_uri = qs['merchant_uri']
account.save()
bank_account = account.bank_accounts.all()[-1]
billing.associate(u"bank account", user.username, account, bank_account.uri)
request.redirect('/bank-account.html')
#=========================================================================== ^L