From 64911f6e83d7a9636dfaefdfdde50c6426654396 Mon Sep 17 00:00:00 2001 From: Gogs Date: Thu, 1 Nov 2018 15:13:09 +0000 Subject: [PATCH] bug fix, new bug with session and dashboard --- src/api/index.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/api/index.py b/src/api/index.py index badda77..77470ae 100755 --- a/src/api/index.py +++ b/src/api/index.py @@ -88,7 +88,7 @@ def home(): return render_template('dashboard.html',context=context,title=title,app_names=apps) def update_plan(uid,plan,auid=None): - url = ":protocol://:host/shop/subscribe/smart-top" + url = ":protocol://:host/store/subscribe/smart-top" url = url.replace(":protocol",CONFIG['protocol']).replace(":host",CONFIG['api']) try: args = {"type":SYS_STORE['class']['read'],"args":SYS_STORE['args']} @@ -99,8 +99,11 @@ def update_plan(uid,plan,auid=None): headers['pid'] = plan if auid is not None: headers["auid"]=json.dumps([auid]) - r = requests.post(url,headers=headers) - + httpclient = requests.session() + r = httpclient.post(url,headers=headers) + #r = requests.post(url,headers=headers) + print url + print [r.text,r.status_code] return json.loads( r.text) except Exception,e: @@ -146,7 +149,6 @@ def register() : plans = update_plan(uid,plan) key = reader.view('users/uid_map',key=uid) - if 'key' not in session : args = {"type":SYS_STORE['class']['write'],"args":SYS_STORE['args']} args['args']['uid'] = key