diff --git a/app/models/base.py b/app/models/base.py index 77575f7..b8665a1 100644 --- a/app/models/base.py +++ b/app/models/base.py @@ -28,7 +28,8 @@ class Base(DeclarativeBase): try: db_session.add(self) await db_session.commit() - return await db_session.refresh(self) + await db_session.refresh(self) + return self except SQLAlchemyError as ex: await logger.aerror(f"Error inserting instance of {self}: {repr(ex)}") raise HTTPException(