Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @celery_app.task
- def delete_users(delete_user_id: int, manager_id: int) -> None:
- """ Удаляет пользователя из чата """
- chat_users = ChatUser.objects.filter(
- id=delete_user_id,
- is_delete=True,
- )
- manager = User.objects.filter(id=manager_id).first()
- for user in chat_users:
- if user.is_delete and user.user_deletion:
- chat_tg_user = TgChatUser.objects.filter(
- tg_user__user = user.user,
- chat = user.chat,
- )
- User.objects.delete_user_from_chat(
- user=manager,
- chat_user=user,
- chat_tg_user=chat_tg_user,
- client=user,
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement