feat(activity): Simplify query statements and improve code readability

This commit is contained in:
Abhimanyu Saharan
2026-02-05 00:21:33 +05:30
parent 79155e9067
commit 51313a9272
12 changed files with 65 additions and 151 deletions

View File

@@ -18,9 +18,7 @@ class AgentAuthContext:
def _find_agent_for_token(session: Session, token: str) -> Agent | None:
agents = list(
session.exec(select(Agent).where(col(Agent.agent_token_hash).is_not(None)))
)
agents = list(session.exec(select(Agent).where(col(Agent.agent_token_hash).is_not(None))))
for agent in agents:
if agent.agent_token_hash and verify_agent_token(token, agent.agent_token_hash):
return agent