Bug fix with initialization function/api

legacy
Steve L. Nyemba 8 years ago
parent e45cd94e07
commit 9b6b0b05f8

@ -36,18 +36,23 @@ COUCHDB = Server(uri=CONFIG['couchdb']['uri']) ;
"""
@app.route("/init/<app_name>",methods=['POST'])
def init(app_name):
plans = []
if 'uid' in request.headers:
uid = request.headers['uid']
plan= request.headers['pid']
couchdb = Couchdb(uri=CONFIG['couchdb']['uri'],dbname=app_name,uid=None)
DB = couchdb.dbase
handler = Domain.User(DB,stripe) ;
handler.init(uid,None)
if 'customer.id' not in session :
handler.init(uid,plan)
id=handler.getId(uid)
session['customer.id'] = id
return ('',204)
else:
id = session['customer.id']
handler.initialize(uid)
handler.update_user(id,uid=uid)
plans = handler.plans()
return (plans,204)
"""
This function will update the user's email
"""

Loading…
Cancel
Save