Skip to content

Commit 793d45a

Browse files
mjunaidcaclaude
andcommitted
style: Format workers.py and auth.py
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b23b911 commit 793d45a

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

apps/api/src/taskflow_api/auth.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,12 @@ async def list_projects(user: CurrentUser = Depends(get_current_user)):
277277
try:
278278
payload = await verify_jwt(token)
279279
user = CurrentUser(payload)
280-
logger.info("[AUTH] Authenticated via JWT: %s, tenant_id=%s, org_ids=%s",
281-
user, user.tenant_id, user.organization_ids)
280+
logger.info(
281+
"[AUTH] Authenticated via JWT: %s, tenant_id=%s, org_ids=%s",
282+
user,
283+
user.tenant_id,
284+
user.organization_ids,
285+
)
282286
return user
283287
except HTTPException:
284288
# JWT validation failed, try opaque as fallback

apps/api/src/taskflow_api/routers/workers.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@
2828

2929
class ProjectInfo(BaseModel):
3030
"""Project summary for worker display."""
31+
3132
id: int
3233
name: str
3334
role: str
3435

3536

3637
class OrgMemberWithProjects(BaseModel):
3738
"""Organization member with their project assignments."""
39+
3840
user_id: str
3941
email: str
4042
name: str
@@ -46,6 +48,7 @@ class OrgMemberWithProjects(BaseModel):
4648

4749
class WorkerListResponse(BaseModel):
4850
"""Combined view of org members and agents."""
51+
4952
org_members: list[OrgMemberWithProjects]
5053
agents: list[dict]
5154
total_members: int
@@ -95,9 +98,7 @@ async def list_workers(
9598
if response.status_code == 401:
9699
raise HTTPException(status_code=401, detail="SSO authentication failed")
97100
if response.status_code == 403:
98-
raise HTTPException(
99-
status_code=403, detail="Not a member of this organization"
100-
)
101+
raise HTTPException(status_code=403, detail="Not a member of this organization")
101102
if response.status_code != 200:
102103
logger.error("[WORKERS] SSO returned %d: %s", response.status_code, response.text)
103104
raise HTTPException(
@@ -127,8 +128,8 @@ async def list_workers(
127128
user_project_map: dict[str, list[tuple[int, str]]] = {}
128129

129130
for project_id in projects:
130-
stmt = select(ProjectMember, Worker).join(Worker).where(
131-
ProjectMember.project_id == project_id
131+
stmt = (
132+
select(ProjectMember, Worker).join(Worker).where(ProjectMember.project_id == project_id)
132133
)
133134
result = await session.exec(stmt)
134135
for membership, worker in result.all():

0 commit comments

Comments
 (0)