fix пригласительных ссылок
This commit is contained in:
@@ -188,9 +188,8 @@ async def create_placements(
|
|||||||
|
|
||||||
channel_details = channel_input.details
|
channel_details = channel_input.details
|
||||||
creative_id = (
|
creative_id = (
|
||||||
(channel_details.creative_id if channel_details and channel_details.creative_id else None)
|
channel_details.creative_id if channel_details and channel_details.creative_id else None
|
||||||
or input.creative_id
|
) or input.creative_id
|
||||||
)
|
|
||||||
|
|
||||||
# Если creative_id передан, ищем и валидируем креатив
|
# Если creative_id передан, ищем и валидируем креатив
|
||||||
creative: domain.Creative | None = None
|
creative: domain.Creative | None = None
|
||||||
@@ -208,14 +207,11 @@ async def create_placements(
|
|||||||
channel_id=channel.id,
|
channel_id=channel.id,
|
||||||
invite_link=None,
|
invite_link=None,
|
||||||
invite_link_type=(
|
invite_link_type=(
|
||||||
channel_details.invite_link_type
|
channel_details.invite_link_type if channel_details and channel_details.invite_link_type else None
|
||||||
if channel_details and channel_details.invite_link_type
|
|
||||||
else None
|
|
||||||
)
|
)
|
||||||
or project.purchase_invite_type_default,
|
or project.purchase_invite_type_default,
|
||||||
status=channel_input.status or domain.PlacementStatus.NO_STATUS,
|
status=channel_input.status or domain.PlacementStatus.NO_STATUS,
|
||||||
comment=channel_input.comment
|
comment=channel_input.comment or (channel_details.comment if channel_details else None),
|
||||||
or (channel_details.comment if channel_details else None),
|
|
||||||
placement_at=channel_details.placement_at 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,
|
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,
|
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
|
# Generate invite_link_name after placement has UUID
|
||||||
short_id = uuid_to_short_id(placement.id)
|
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)
|
await self.database.update_placement(placement)
|
||||||
|
|
||||||
placements.append(placement)
|
placements.append(placement)
|
||||||
|
|||||||
Reference in New Issue
Block a user