Багфикс
This commit is contained in:
parent
4acf393d2b
commit
93658a0aa3
3 changed files with 6 additions and 6 deletions
|
@ -58,7 +58,7 @@ class ChatDAO(BaseDAO):
|
|||
stmt = insert(UserChat).values(user_id=user_id, chat_id=chat_id)
|
||||
await self.session.execute(stmt)
|
||||
except IntegrityError:
|
||||
pass
|
||||
raise UserAlreadyInChatException
|
||||
|
||||
async def change_data(self, chat_id: int, chat_name: str, avatar_image: HttpUrl) -> None:
|
||||
stmt = (
|
||||
|
|
|
@ -51,7 +51,8 @@ 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)
|
||||
if user_id != settings.ADMIN_USER_ID:
|
||||
await uow.chat.add_user_to_chat(settings.ADMIN_USER_ID, chat_id)
|
||||
async with RedisService(is_raise=True) as redis:
|
||||
await redis.delete_key(key=f"user_allowed_chats: {user_id}")
|
||||
await uow.commit()
|
||||
|
|
|
@ -24,10 +24,9 @@ class UnitOfWork:
|
|||
await self.rollback()
|
||||
await self.session.close()
|
||||
except SQLAlchemyError:
|
||||
pass
|
||||
# raise BlackPhoenixException
|
||||
# if isinstance(exc, SQLAlchemyError):
|
||||
# raise BlackPhoenixException
|
||||
raise BlackPhoenixException
|
||||
if isinstance(exc, SQLAlchemyError):
|
||||
raise BlackPhoenixException
|
||||
|
||||
async def commit(self):
|
||||
await self.session.commit()
|
||||
|
|
Loading…
Add table
Reference in a new issue