fix: add missing commas for syntax correctness across multiple files
Test / test (push) Successful in 15s
Test / test (push) Successful in 15s
This commit is contained in:
@@ -169,7 +169,7 @@ class AnalyticsService:
|
||||
return _deserialize_summary(payload)
|
||||
|
||||
async def _store_summary_cache(
|
||||
self, organization_id: int, days: int, summary: DealSummary
|
||||
self, organization_id: int, days: int, summary: DealSummary,
|
||||
) -> None:
|
||||
if not self._is_cache_enabled() or self._cache is None:
|
||||
return
|
||||
@@ -187,7 +187,7 @@ class AnalyticsService:
|
||||
return _deserialize_funnel(payload)
|
||||
|
||||
async def _store_funnel_cache(
|
||||
self, organization_id: int, breakdowns: list[StageBreakdown]
|
||||
self, organization_id: int, breakdowns: list[StageBreakdown],
|
||||
) -> None:
|
||||
if not self._is_cache_enabled() or self._cache is None:
|
||||
return
|
||||
@@ -321,7 +321,7 @@ def _deserialize_funnel(payload: Any) -> list[StageBreakdown] | None:
|
||||
|
||||
|
||||
async def invalidate_analytics_cache(
|
||||
cache: Redis | None, organization_id: int, backoff_ms: int
|
||||
cache: Redis | None, organization_id: int, backoff_ms: int,
|
||||
) -> None:
|
||||
"""Remove cached analytics payloads for the organization."""
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ class ContactService:
|
||||
)
|
||||
try:
|
||||
return await self._repository.list(
|
||||
params=params, role=context.role, user_id=context.user_id
|
||||
params=params, role=context.role, user_id=context.user_id,
|
||||
)
|
||||
except ContactAccessError as exc:
|
||||
raise ContactForbiddenError(str(exc)) from exc
|
||||
@@ -126,7 +126,7 @@ class ContactService:
|
||||
return contact
|
||||
try:
|
||||
return await self._repository.update(
|
||||
contact, payload, role=context.role, user_id=context.user_id
|
||||
contact, payload, role=context.role, user_id=context.user_id,
|
||||
)
|
||||
except ContactAccessError as exc:
|
||||
raise ContactForbiddenError(str(exc)) from exc
|
||||
|
||||
@@ -79,7 +79,7 @@ class DealService:
|
||||
await self._ensure_contact_in_organization(data.contact_id, context.organization_id)
|
||||
deal = await self._repository.create(data=data, role=context.role, user_id=context.user_id)
|
||||
await invalidate_analytics_cache(
|
||||
self._cache, context.organization_id, self._cache_backoff_ms
|
||||
self._cache, context.organization_id, self._cache_backoff_ms,
|
||||
)
|
||||
return deal
|
||||
|
||||
@@ -120,7 +120,7 @@ class DealService:
|
||||
return deal
|
||||
|
||||
updated = await self._repository.update(
|
||||
deal, changes, role=context.role, user_id=context.user_id
|
||||
deal, changes, role=context.role, user_id=context.user_id,
|
||||
)
|
||||
await self._log_activities(
|
||||
deal_id=deal.id,
|
||||
@@ -128,7 +128,7 @@ class DealService:
|
||||
activities=[activity for activity in [stage_activity, status_activity] if activity],
|
||||
)
|
||||
await invalidate_analytics_cache(
|
||||
self._cache, context.organization_id, self._cache_backoff_ms
|
||||
self._cache, context.organization_id, self._cache_backoff_ms,
|
||||
)
|
||||
return updated
|
||||
|
||||
@@ -150,7 +150,7 @@ class DealService:
|
||||
return
|
||||
for activity_type, payload in entries:
|
||||
activity = Activity(
|
||||
deal_id=deal_id, author_id=author_id, type=activity_type, payload=payload
|
||||
deal_id=deal_id, author_id=author_id, type=activity_type, payload=payload,
|
||||
)
|
||||
self._repository.session.add(activity)
|
||||
await self._repository.session.flush()
|
||||
@@ -160,7 +160,7 @@ class DealService:
|
||||
raise DealOrganizationMismatchError("Operation targets a different organization")
|
||||
|
||||
async def _ensure_contact_in_organization(
|
||||
self, contact_id: int, organization_id: int
|
||||
self, contact_id: int, organization_id: int,
|
||||
) -> Contact:
|
||||
contact = await self._repository.session.get(Contact, contact_id)
|
||||
if contact is None or contact.organization_id != organization_id:
|
||||
@@ -185,5 +185,5 @@ class DealService:
|
||||
effective_amount = updates.amount if updates.amount is not None else deal.amount
|
||||
if effective_amount is None or Decimal(effective_amount) <= Decimal("0"):
|
||||
raise DealStatusValidationError(
|
||||
"Amount must be greater than zero to mark a deal as won"
|
||||
"Amount must be greater than zero to mark a deal as won",
|
||||
)
|
||||
|
||||
@@ -56,7 +56,7 @@ class OrganizationService:
|
||||
self._repository = repository
|
||||
|
||||
async def get_context(
|
||||
self, *, user_id: int, organization_id: int | None
|
||||
self, *, user_id: int, organization_id: int | None,
|
||||
) -> OrganizationContext:
|
||||
"""Resolve request context ensuring the user belongs to the given organization."""
|
||||
|
||||
@@ -70,7 +70,7 @@ class OrganizationService:
|
||||
return OrganizationContext(organization=membership.organization, membership=membership)
|
||||
|
||||
def ensure_entity_in_context(
|
||||
self, *, entity_organization_id: int, context: OrganizationContext
|
||||
self, *, entity_organization_id: int, context: OrganizationContext,
|
||||
) -> None:
|
||||
"""Make sure a resource belongs to the current organization."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user