Пример #1
0
def account():
    user = User.load_current_user()
    stripe.api_key = STRIPE_SECRET
    try:
        customer = stripe.Customer.retrieve(user.stripe_customer_id)
    except:
        customer = False
    mail = MailingAddress.get_by_username(user.username)
    return render_template('account.html', customer=customer, mail=mail)
Пример #2
0
def update_address():
    user = User.load_current_user()    
    form = AddressForm(request.form)
    m = MailingAddress.get_by_username(user.username)
    m.name = form.name.data
    m.address1 = form.address1.data
    m.address2 = form.address2.data
    m.zipcode = form.zipcode.data
    m.city = form.city.data
    m.state = form.state.data 
    m.country = form.country.data
    m.put()
    return redirect(url_for('account'))
Пример #3
0
def edit_address():
    user = User.load_current_user()
    mail = MailingAddress.get_by_username(user.username)
    form = AddressForm(obj=mail)
    return render_template('address_edit.html', form=form)