fix with subscription and removed print statements

community
Steve L. Nyemba 6 years ago
parent c2d188d556
commit 58e675c789

@ -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:
@ -135,11 +137,11 @@ def register() :
key = None key = None
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
@ -156,7 +158,7 @@ def register() :
writer.write(label='hash',data=auid) writer.write(label='hash',data=auid)
session['key'] = key session['key'] = key
if plans : if plans :
session['user-plan'] = plans session['user-plan'] = plans
return ('',204) return ('',204)
return "",403 return "",403

@ -1 +1 @@
Subproject commit 34df3788e1fea826703301741b32f7782b7ef455 Subproject commit 3599fff083f1661a1762992d3891210d6c3aec05

@ -55,7 +55,7 @@
height:90%; height:90%;
} }
.widget .chart iframe { .widget .chart .info {
width:99%; width:99%;
min-height:90%; min-height:90%;
@ -125,7 +125,17 @@
.dialog .title { font-weight: bold; padding:4px; margin-bottom:4px; background:#f3f3f3; } .dialog .title { font-weight: bold; padding:4px; margin-bottom:4px; background:#f3f3f3; }
.dialog .title i {color:ff5733} .dialog .title i {color:ff5733}
.dialog .message {padding:8px; font-family:verdana; min-height:10%} .dialog .message {padding:8px; font-family:verdana; min-height:10%}
@media screen and (min-width: 1280px){ @media screen and (min-width: 1024px){
.widget .chart {
display:grid;
grid-template-columns: 35% 35% 30%;
grid-template-rows:100%;
grid-gap:1px;
width:100%;
height:90%;
}
.widget .chart .info { .widget .chart .info {
width:99%; width:99%;
min-height:75%; min-height:75%;

Loading…
Cancel
Save