summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Dobrowolski <admin@tastycode.pl>2018-05-04 13:03:20 +0200
committerPiotr Dobrowolski <admin@tastycode.pl>2018-05-04 13:03:20 +0200
commit0c7ffc9a2ab1d6123e2188c815ba9272f56f5983 (patch)
tree393dc23c16b2c2d364647395209dd1732f32d1f1
parente4f6dcbbaa68598ea9f517489a9625e5301b09da (diff)
downloadcheckinator-0c7ffc9a2ab1d6123e2188c815ba9272f56f5983.tar.gz
checkinator-0c7ffc9a2ab1d6123e2188c815ba9272f56f5983.tar.bz2
checkinator-0c7ffc9a2ab1d6123e2188c815ba9272f56f5983.zip
Fix custom SPECIAL_DEVICES
-rw-r--r--at.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/at.py b/at.py
index 9e1dfa0..05d78a0 100644
--- a/at.py
+++ b/at.py
@@ -240,7 +240,7 @@ def main_view():
@app.route('/api')
def list_all():
- result = now_at()
+ data = now_at()
def prettify_user((user, atime)):
return {
@@ -248,10 +248,9 @@ def list_all():
'timestamp': atime,
'pretty_time': strfts(atime),
}
- result['users'] = map(prettify_user, result['users'])
- result['unknown'] = len(result['unknown'])
- result['kektops'] = len(result['kektops'])
- result['esps'] = len(result['esps'])
+ result = {}
+ result['users'] = map(prettify_user, data.pop('users'))
+ result.update((k, len(v)) for k, v in data.items())
res = make_response(json.dumps(result), 200)
res.headers['Access-Control-Allow-Origin'] = '*'
return res