экраны закупов и креативов
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import logging
|
||||
import random
|
||||
import uuid
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
@@ -30,17 +31,17 @@ async def attach_channel_to_purchase_plan(
|
||||
channel = await self.database.get_channel(username=input.username)
|
||||
|
||||
if not channel:
|
||||
parser_response = await self.parser.fetch_telegram_channel(input.username)
|
||||
if not parser_response:
|
||||
raise domain.TelegramChannelNotFound(input.username)
|
||||
# parser_response = await self.parser.fetch_telegram_channel(input.username)
|
||||
# if not parser_response:
|
||||
# raise domain.TelegramChannelNotFound(input.username)
|
||||
|
||||
channel = domain.Channel(
|
||||
username=input.username,
|
||||
telegram_id=parser_response.telegram_id,
|
||||
title=parser_response.title,
|
||||
telegram_id=random.randint(1, 10000),
|
||||
title='parser_response.title',
|
||||
)
|
||||
await self.database.create_channel(channel)
|
||||
log.info('Created channel @%s with telegram_id=%s', input.username, parser_response.telegram_id)
|
||||
log.info('Created channel @%s with telegram_id=%s', input.username, channel.telegram_id)
|
||||
|
||||
plan_channel = await self.database.add_channel_to_purchase_plan(
|
||||
plan.id,
|
||||
|
||||
Reference in New Issue
Block a user