remove useless search in users query
This commit is contained in:
parent
cef8cb0bbf
commit
c2f3e97611
1 changed files with 3 additions and 6 deletions
|
@ -113,11 +113,8 @@ class DataBase:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
with self.lock:
|
with self.lock:
|
||||||
self.cur.execute("SELECT * FROM users")
|
self.cur.execute("SELECT * FROM users where mxid = ?", [mxid])
|
||||||
users = self.cur.fetchall()
|
|
||||||
|
|
||||||
user: dict = next(
|
user = self.cur.fetchone()
|
||||||
iter([user for user in users if user["mxid"] == mxid]), {}
|
|
||||||
)
|
|
||||||
|
|
||||||
return user
|
return {} if not user else user
|
||||||
|
|
Loading…
Reference in a new issue