fix Token db interface
This commit is contained in:
1 parent
0bb7ca21cf
commit
8b94f36db5
1 file changed
+2
-2
@@ -416,7 +416,7 @@ class Token:
|
|||||||
|
|
||||||
|
|
||||||
def get_user(db_path: str, token: str) -> int:
|
def get_user(db_path: str, token: str) -> int:
|
||||||
if not Token.exists(db_path, userid):
|
if not Token.exists(db_path, token):
|
||||||
raise ValueError("Token does not exist")
|
raise ValueError("Token does not exist")
|
||||||
|
|
||||||
with sqlite3.connect(db_path) as connection:
|
with sqlite3.connect(db_path) as connection:
|
||||||
@@ -429,4 +429,4 @@ class Token:
|
|||||||
WHERE tkhash = ?
|
WHERE tkhash = ?
|
||||||
''', (tkhash, ))
|
''', (tkhash, ))
|
||||||
|
|
||||||
return cursor.fetcone()[0]
|
return cursor.fetchone()[0]
|
||||||
Reference in new issue
Block a user