style: ruff format 10 python files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jason Staack
2026-03-19 13:49:59 -05:00
parent 9d6b68760f
commit 6a5829e0ff
10 changed files with 41 additions and 67 deletions

View File

@@ -36,14 +36,18 @@ router = APIRouter(tags=["links"])
)
async def list_links(
tenant_id: uuid.UUID,
state: Optional[str] = Query(None, description="Filter by link state (active, degraded, down, stale)"),
state: Optional[str] = Query(
None, description="Filter by link state (active, degraded, down, stale)"
),
device_id: Optional[uuid.UUID] = Query(None, description="Filter by device (AP or CPE side)"),
current_user: CurrentUser = Depends(get_current_user),
db: AsyncSession = Depends(get_db),
) -> LinkListResponse:
"""List all wireless links for a tenant with optional state and device filters."""
await _check_tenant_access(current_user, tenant_id, db)
return await link_service.get_links(db=db, tenant_id=tenant_id, state=state, device_id=device_id)
return await link_service.get_links(
db=db, tenant_id=tenant_id, state=state, device_id=device_id
)
@router.get(
@@ -91,7 +95,9 @@ async def list_device_registrations(
) -> RegistrationListResponse:
"""Get latest wireless registration data for a device (most recent per MAC)."""
await _check_tenant_access(current_user, tenant_id, db)
return await link_service.get_device_registrations(db=db, tenant_id=tenant_id, device_id=device_id)
return await link_service.get_device_registrations(
db=db, tenant_id=tenant_id, device_id=device_id
)
@router.get(

View File

@@ -98,9 +98,7 @@ async def get_alert_rule(
db=db, tenant_id=tenant_id, site_id=site_id, rule_id=rule_id
)
if not result:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND, detail="Alert rule not found"
)
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Alert rule not found")
return result
@@ -124,9 +122,7 @@ async def update_alert_rule(
db=db, tenant_id=tenant_id, site_id=site_id, rule_id=rule_id, data=data
)
if not result:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND, detail="Alert rule not found"
)
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Alert rule not found")
return result
@@ -149,9 +145,7 @@ async def delete_alert_rule(
db=db, tenant_id=tenant_id, site_id=site_id, rule_id=rule_id
)
if not deleted:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND, detail="Alert rule not found"
)
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Alert rule not found")
# ---------------------------------------------------------------------------

View File

@@ -166,9 +166,7 @@ async def unassign_device(
) -> None:
"""Remove a device from a site. Requires operator role or above."""
await _check_tenant_access(current_user, tenant_id, db)
await site_service.remove_device_from_site(
db=db, tenant_id=tenant_id, device_id=device_id
)
await site_service.remove_device_from_site(db=db, tenant_id=tenant_id, device_id=device_id)
@router.post(