- Reformatted function signatures in `organization_service.py` and `task_service.py` for better alignment. - Updated import statements across multiple files for consistency and organization. - Enhanced test files by improving formatting and ensuring consistent use of async session factories. - Added type hints and improved type safety in various service and test files. - Adjusted `pyproject.toml` to include configuration for isort, mypy, and ruff for better code quality checks. - Cleaned up unused imports and organized existing ones in several test files.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
"""Business logic for contact workflows."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Sequence
|
||||
@@ -78,7 +79,9 @@ class ContactService:
|
||||
owner_id=filters.owner_id,
|
||||
)
|
||||
try:
|
||||
return await self._repository.list(params=params, role=context.role, user_id=context.user_id)
|
||||
return await self._repository.list(
|
||||
params=params, role=context.role, user_id=context.user_id
|
||||
)
|
||||
except ContactAccessError as exc:
|
||||
raise ContactForbiddenError(str(exc)) from exc
|
||||
|
||||
@@ -122,7 +125,9 @@ class ContactService:
|
||||
if not payload:
|
||||
return contact
|
||||
try:
|
||||
return await self._repository.update(contact, payload, role=context.role, user_id=context.user_id)
|
||||
return await self._repository.update(
|
||||
contact, payload, role=context.role, user_id=context.user_id
|
||||
)
|
||||
except ContactAccessError as exc:
|
||||
raise ContactForbiddenError(str(exc)) from exc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user