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

This commit is contained in:
Marshall Hallenbeck
2023-03-06 17:55:21 -05:00
parent 1547416e85
commit 0a044ed740
+3 -4
View File
@@ -742,11 +742,10 @@ class database:
"""
Check if this group ID is valid.
"""
results = self.conn.query(self.GroupsTable).filter(
q = select(self.GroupsTable).filter(
self.GroupsTable.c.id == group_id
).first()
self.conn.commit()
self.conn.close()
)
results = asyncio.run(self.conn.execute(q)).first()
valid = True if results else False
logging.debug(f"is_group_valid(groupID={group_id}) => {valid}")