Commit 3509361d authored by okhin's avatar okhin
Browse files

We need only one line to check admin against

parent 74706482
Pipeline #787 passed with stage
in 3 seconds
......@@ -505,7 +505,7 @@ def static_files(filepath):
def little_admin(db):
# We need to check if we're admin
admin = db.execute('SELECT admin FROM users WHERE api = ?', (request.params['api'],));
admin = admin.fetchall()
admin = admin.fetchone()
if admin[0] != 1:
abort(403, "You need to have an admin access")
users = db.execute('SELECT api, token, admin FROM users').fetchall()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment