Commit a64b8045 authored by Vladislav Rykov's avatar Vladislav Rykov
Browse files

device last time up fixed

parent 5eb53579
......@@ -161,11 +161,17 @@ def dev():
dh = dd.DeviceDao()
if request.method == 'GET':
dev = dh.get(session['appkey'], request.args.get('id'))
ltup = 'recently'
session['devid'] = dev[1][1]
session['devname'] = dev[1][0]
last = data.get_last_n(session['appkey'], session['devid'], 1)
ltup = 'Device have not sent data yet'
if last[0]:
ltup = last[1][0][1]
return render_template('dev.html', dev=dev[1], appkey=session['appkey'], ltup=ltup)
else:
res = dh.create(request.form['devname'], request.form['devid'], session['appkey'], request.form['devdesc'])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment