|
|
@ -91,6 +91,7 @@ def update_plan(uid,plan,auid=None):
|
|
|
|
url = ":protocol://:host/store/subscribe/smart-top"
|
|
|
|
url = ":protocol://:host/store/subscribe/smart-top"
|
|
|
|
url = url.replace(":protocol",CONFIG['protocol']).replace(":host",CONFIG['api'])
|
|
|
|
url = url.replace(":protocol",CONFIG['protocol']).replace(":host",CONFIG['api'])
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
|
|
|
|
|
|
|
|
args = {"type":SYS_STORE['class']['read'],"args":SYS_STORE['args']}
|
|
|
|
args = {"type":SYS_STORE['class']['read'],"args":SYS_STORE['args']}
|
|
|
|
# reader = factory.instance(**args)
|
|
|
|
# reader = factory.instance(**args)
|
|
|
|
|
|
|
|
|
|
|
@ -99,9 +100,10 @@ def update_plan(uid,plan,auid=None):
|
|
|
|
headers['pid'] = plan
|
|
|
|
headers['pid'] = plan
|
|
|
|
if auid is not None:
|
|
|
|
if auid is not None:
|
|
|
|
headers["auid"]=json.dumps([auid])
|
|
|
|
headers["auid"]=json.dumps([auid])
|
|
|
|
httpclient = requests.session()
|
|
|
|
# httpclient = requests.session()
|
|
|
|
r = httpclient.post(url,headers=headers)
|
|
|
|
# r = httpclient.post(url,headers=headers)
|
|
|
|
#r = requests.post(url,headers=headers)
|
|
|
|
r = requests.post(url,headers=headers)
|
|
|
|
|
|
|
|
|
|
|
|
return json.loads( r.text)
|
|
|
|
return json.loads( r.text)
|
|
|
|
|
|
|
|
|
|
|
|
except Exception,e:
|
|
|
|
except Exception,e:
|
|
|
@ -136,10 +138,10 @@ def register() :
|
|
|
|
|
|
|
|
|
|
|
|
if 'key' not in session :
|
|
|
|
if 'key' not in session :
|
|
|
|
key = reader.view('users/uid_map',key=uid)
|
|
|
|
key = reader.view('users/uid_map',key=uid)
|
|
|
|
# if key :
|
|
|
|
|
|
|
|
# session['key'] = key
|
|
|
|
|
|
|
|
if key :
|
|
|
|
if key :
|
|
|
|
plans = reader.view('users/active_plan',key=str(key))
|
|
|
|
plans = reader.view('users/active_plan',key=str(key))
|
|
|
|
|
|
|
|
session['key'] = key
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
plans = None
|
|
|
|
plans = None
|
|
|
|
plan = body['plan'] if 'plan' in body else CONFIG['default_plan']#-- default plan
|
|
|
|
plan = body['plan'] if 'plan' in body else CONFIG['default_plan']#-- default plan
|
|
|
|