90% сеньоров плачат на таких коммитах

This commit is contained in:
Artem Tsyrulnikov
2025-12-15 19:10:41 +03:00
parent fda91cb6d8
commit 71e5a38efc
42 changed files with 403 additions and 302 deletions

View File

@@ -15,9 +15,7 @@ async def get_workspace_projects(
allowed_project_ids = context.allowed_project_ids(domain.PermissionKey.PROJECTS_READ)
projects = await self.database.get_workspace_projects(
input.workspace_id, allowed_project_ids=allowed_project_ids
)
projects = await self.database.get_workspace_projects(input.workspace_id, allowed_project_ids=allowed_project_ids)
return dto.GetWorkspaceProjectsOutput(
projects=[

View File

@@ -70,7 +70,7 @@ async def tg_add_project_1(self: 'Usecase', input: dto.ConnectProjectInput) -> d
if len(workspaces) == 1:
workspace = workspaces[0]
channel = await self.database.get_channel(workspace.id, telegram_id=input.telegram_id)
channel = await self.database.get_channel(telegram_id=input.telegram_id)
if channel:
channel.title = input.title
channel.username = input.username
@@ -80,8 +80,6 @@ async def tg_add_project_1(self: 'Usecase', input: dto.ConnectProjectInput) -> d
telegram_id=input.telegram_id,
title=input.title,
username=input.username,
verification_status=domain.ChannelVerificationStatus.VERIFIED,
workspace_id=workspace.id,
)
await self.database.create_channel(channel)

View File

@@ -66,7 +66,7 @@ async def tg_add_project_2(
return
telegram_channel_id = int(channel_data['telegram_id'])
channel = await self.database.get_channel(workspace.id, telegram_id=telegram_channel_id)
channel = await self.database.get_channel(telegram_id=telegram_channel_id)
if channel:
channel.title = str(channel_data['title'])
channel.username = channel_data.get('username')
@@ -76,7 +76,6 @@ async def tg_add_project_2(
telegram_id=telegram_channel_id,
title=str(channel_data['title']),
username=channel_data.get('username'),
workspace_id=workspace.id,
)
await self.database.create_channel(channel)