diff --git a/app/models/base.py b/app/models/base.py index d7a665d..c79be3b 100644 --- a/app/models/base.py +++ b/app/models/base.py @@ -37,7 +37,7 @@ class Base: db_session.add(self) return await db_session.commit() except SQLAlchemyError as ex: - raise HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail=repr(ex)) + raise HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail=repr(ex)) from ex async def delete(self, db_session: AsyncSession): """ @@ -50,7 +50,7 @@ class Base: await db_session.commit() return True except SQLAlchemyError as ex: - raise HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail=repr(ex)) + raise HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail=repr(ex)) from ex async def update(self, db_session: AsyncSession, **kwargs): """