lint B904

This commit is contained in:
Jakub Miazek 2022-12-16 08:40:02 +01:00
parent 83946d52f7
commit e9d3920c81

View File

@ -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):
"""