feat: миграция с булевых переменных на status для target_channel
This commit is contained in:
@@ -29,8 +29,8 @@ async def update_target_chan_permissions(self: 'Usecase', input: dto.UpdateTarge
|
||||
raise domain.TargetChannelNotFound()
|
||||
|
||||
if not missing_permissions:
|
||||
if not channel.is_active:
|
||||
channel.is_active = True
|
||||
if channel.status != domain.TargetChannelStatus.ACTIVE:
|
||||
channel.status = domain.TargetChannelStatus.ACTIVE
|
||||
await self.database.update_target_channel(channel)
|
||||
|
||||
await self.telegram_bot.send_message(
|
||||
@@ -40,8 +40,8 @@ async def update_target_chan_permissions(self: 'Usecase', input: dto.UpdateTarge
|
||||
log.info(f'Target channel {input.telegram_id} reactivated - all permissions granted')
|
||||
return
|
||||
|
||||
if channel.is_active:
|
||||
channel.is_active = False
|
||||
if channel.status == domain.TargetChannelStatus.ACTIVE:
|
||||
channel.status = domain.TargetChannelStatus.INACTIVE
|
||||
await self.database.update_target_channel(channel)
|
||||
|
||||
missed_permissions = '\n'.join(f'• {p}' for p in missing_permissions)
|
||||
|
||||
Reference in New Issue
Block a user