1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/shaarli_ynh.git synced 2024-09-03 20:26:10 +02:00
shaarli_ynh/conf/user_list.py
lapineige 9d73f6a7c0 Fix user listing syntax
Fix the error:
> TypeError: string indices must be integers
Caused by `print "{0}".format("\n".join(i["username"] for i in userlist))`
`userlist` is a dictionary with {account :{dictionary of parameters}} so I use values() to return the dictionary of parameters.
2016-11-06 15:32:35 +01:00

3 lines
144 B
Python

import sys, json
userlist=json.loads(sys.stdin.readlines()[0])["users"]
print "{0}".format("\n".join(i["username"] for i in userlist.values()))