chore(quality): apply ruff autofixes and formatting (223 fixes, regression-free: 118/118 tests pass)

This commit is contained in:
Agent Zero
2026-06-10 21:24:24 +00:00
committed by leocrm-bot
parent 7104335334
commit b5f7a220fe
56 changed files with 459 additions and 528 deletions
+9 -5
View File
@@ -11,7 +11,7 @@ router layer passes `current_user.org_id`.
from __future__ import annotations
from typing import Any, Optional
from typing import Any
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
@@ -44,7 +44,7 @@ class OrgScopedQuery:
self,
skip: int = 0,
limit: int = 20,
order_by: Optional[Any] = None,
order_by: Any | None = None,
**filters: Any,
) -> list[Any]:
"""List records scoped to org, with optional filters and pagination."""
@@ -65,9 +65,13 @@ class OrgScopedQuery:
"""Count records scoped to org, with optional filters."""
from sqlalchemy import func as sa_func
stmt = select(sa_func.count()).select_from(self.model).where(
self.model.org_id == self.org_id,
self.model.deleted_at.is_(None),
stmt = (
select(sa_func.count())
.select_from(self.model)
.where(
self.model.org_id == self.org_id,
self.model.deleted_at.is_(None),
)
)
for field, value in filters.items():
if value is not None: