1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/shaarli_ynh.git synced 2024-09-03 20:26:10 +02:00

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.
This commit is contained in:
lapineige 2016-11-06 15:32:35 +01:00 committed by GitHub
parent abd2b745ad
commit 9d73f6a7c0

View file

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