Багфикс
This commit is contained in:
parent
8eb21b6afe
commit
43ae5b9346
1 changed files with 6 additions and 2 deletions
|
@ -3,7 +3,8 @@ from urllib.parse import urljoin
|
|||
|
||||
from pydantic import ValidationError
|
||||
|
||||
from app.chat.exceptions import UserDontHavePermissionException, UserCanNotReadThisChatException
|
||||
from app.chat.exceptions import UserDontHavePermissionException, UserCanNotReadThisChatException, \
|
||||
UserAlreadyInChatException
|
||||
from app.chat.shemas import SAllowedChats, SChangeData, SPinnedChats, SChat
|
||||
from app.config import settings
|
||||
from app.services.redis_service import RedisService
|
||||
|
@ -50,7 +51,10 @@ class ChatService:
|
|||
avatar_image=user_chat_for.avatar_image
|
||||
)
|
||||
await uow.chat.add_user_to_chat(user_id, chat_id)
|
||||
await uow.chat.add_user_to_chat(settings.ADMIN_USER_ID, chat_id)
|
||||
try:
|
||||
await uow.chat.add_user_to_chat(settings.ADMIN_USER_ID, chat_id)
|
||||
except UserAlreadyInChatException:
|
||||
pass
|
||||
async with RedisService(is_raise=True) as redis:
|
||||
await redis.delete_key(key=f"user_allowed_chats: {user_id}")
|
||||
await uow.commit()
|
||||
|
|
Loading…
Add table
Reference in a new issue