fix(cmedb): update get_computers to always return a list

main
Marshall Hallenbeck 2023-03-06 18:26:58 -05:00
parent 3dd1daf87b
commit fde187e26e
1 changed files with 2 additions and 2 deletions

View File

@ -693,7 +693,6 @@ class database:
q.filter(
func.lower(self.UsersTable.c.username).like(func.lower(f"%{filter_term}%"))
)
results = asyncio.run(self.conn.execute(q)).all()
return results
@ -727,7 +726,8 @@ class database:
self.ComputersTable.c.id == filter_term
)
results = asyncio.run(self.conn.execute(q)).first()
return results
# all() returns a list, so we keep the return format the same so consumers don't have to guess
return [results]
# if we're filtering by domain controllers
elif filter_term == 'dc':
q.filter(