diff --git a/src/usecase/purchase/create_placements.py b/src/usecase/purchase/create_placements.py index 5430473..5b86ebf 100644 --- a/src/usecase/purchase/create_placements.py +++ b/src/usecase/purchase/create_placements.py @@ -188,9 +188,8 @@ async def create_placements( channel_details = channel_input.details creative_id = ( - (channel_details.creative_id if channel_details and channel_details.creative_id else None) - or input.creative_id - ) + channel_details.creative_id if channel_details and channel_details.creative_id else None + ) or input.creative_id # Если creative_id передан, ищем и валидируем креатив creative: domain.Creative | None = None @@ -208,14 +207,11 @@ async def create_placements( channel_id=channel.id, invite_link=None, invite_link_type=( - channel_details.invite_link_type - if channel_details and channel_details.invite_link_type - else None + channel_details.invite_link_type if channel_details and channel_details.invite_link_type else None ) or project.purchase_invite_type_default, status=channel_input.status or domain.PlacementStatus.NO_STATUS, - comment=channel_input.comment - or (channel_details.comment if channel_details else None), + comment=channel_input.comment or (channel_details.comment if channel_details else None), placement_at=channel_details.placement_at if channel_details else None, payment_at=channel_details.payment_at if channel_details else None, cost_type=channel_details.cost.type if channel_details and channel_details.cost else None, @@ -239,7 +235,7 @@ async def create_placements( # Generate invite_link_name after placement has UUID short_id = uuid_to_short_id(placement.id) - placement.invite_link_name = generate_invite_link_name(short_id, project.channel.title) + placement.invite_link_name = generate_invite_link_name(short_id, channel.title) await self.database.update_placement(placement) placements.append(placement)