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:
parent
abd2b745ad
commit
9d73f6a7c0
1 changed files with 1 additions and 1 deletions
|
@ -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()))
|
||||
|
|
Loading…
Reference in a new issue