feat(cmedb): update is_user_valid to use proper sqlalchemy syntax

main
Marshall Hallenbeck 2023-03-06 17:38:42 -05:00
parent 22606143da
commit d4fe0c18d8
1 changed files with 3 additions and 4 deletions

View File

@ -720,11 +720,10 @@ class database:
"""
Check if this User ID is valid.
"""
results = self.conn.query(self.UsersTable).filter(
q = select(self.UsersTable).filter(
self.UsersTable.c.id == user_id
).first()
self.conn.commit()
self.conn.close()
)
results = asyncio.run(self.conn.execute(q)).all()
return len(results) > 0
def get_users(self, filter_term=None):