diff options
Diffstat (limited to 'pyload/database/User.py')
-rw-r--r-- | pyload/database/User.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/pyload/database/User.py b/pyload/database/User.py index e11961e32..df510c54f 100644 --- a/pyload/database/User.py +++ b/pyload/database/User.py @@ -76,24 +76,18 @@ class UserMethods(object): @style.queue def listUsers(db): db.c.execute('SELECT name FROM users') - users = [] - for row in db.c: - users.append(row[0]) - return users + return [row[0] for row in db.c] @style.queue def getAllUserData(db): db.c.execute("SELECT name, permission, role, template, email FROM users") - user = {} - for r in db.c: - user[r[0]] = {"permission": r[1], "role": r[2], "template": r[3], "email": r[4]} - - return user + return {{"permission": r[1], "role": r[2], "template": r[3], "email": r[4]} for r in db.c} @style.queue def removeUser(db, user): db.c.execute('DELETE FROM users WHERE name=?', (user,)) + DatabaseBackend.registerSub(UserMethods) |