Commit 3c091153 authored by okhin's avatar okhin 🚴

Need to create a specific db object for the login_admin, not using the global one. Because thread.

parent 85dbc7b0
...@@ -464,6 +464,7 @@ def static_files(filepath): ...@@ -464,6 +464,7 @@ def static_files(filepath):
return static_file(filepath, root='./views') return static_file(filepath, root='./views')
def login_admin(user, password): def login_admin(user, password):
db = sqlite3.connect(config['piphone']['db'])
user = db.execute('SELECT api, token, admin FROM users where api = ?', user) user = db.execute('SELECT api, token, admin FROM users where api = ?', user)
user = user.fetchone() user = user.fetchone()
if user is None: if user is None:
......
Markdown is supported
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