исправил линтеры

This commit is contained in:
Artem Tsyrulnikov
2026-01-28 12:52:23 +03:00
parent 484e52c077
commit 632fa4b971
9 changed files with 128 additions and 36 deletions

View File

@@ -17,11 +17,13 @@ async def handle_subscription(
first_name: str | None = None,
last_name: str | None = None,
) -> None:
placement = await self.database.get_placement_by_invite_link(invite_link)
if not placement:
log.warning('Placement not found for invite_link: %s', invite_link)
placement_post = await self.database.get_placement_post_by_invite_link(invite_link)
if not placement_post or not placement_post.placement:
log.warning('PlacementPost not found for invite_link: %s', invite_link)
return
placement = placement_post.placement
subscriber = await self.database.get_telegram_user(telegram_id=user_telegram_id)
if not subscriber:
subscriber = domain.TelegramUser(
@@ -57,6 +59,7 @@ async def handle_subscription(
return
# Проверяем, была ли раньше подписка через ЭТОТ placement (для реактивации)
# Note: Subscription now links to placement directly, not placement_post
existing_sub = await self.database.get_subscription_by_subscriber_and_placement(
subscriber.id, placement.id
)