From fa7a1c8a616e5d65ec84557e1281f2701af3f7db Mon Sep 17 00:00:00 2001 From: creyD Date: Mon, 13 May 2024 09:22:06 +0000 Subject: [PATCH] Adjusted files for isort & autopep --- creyPY/fastapi/crud.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/creyPY/fastapi/crud.py b/creyPY/fastapi/crud.py index 9034355..73844cb 100644 --- a/creyPY/fastapi/crud.py +++ b/creyPY/fastapi/crud.py @@ -10,7 +10,9 @@ from .models.base import Base T = TypeVar("T", bound=Base) -def get_object_or_404(db_class: Type[T], id: UUID | str, db: Session, expunge: bool = False, lookup_column: str = "id") -> T: +def get_object_or_404( + db_class: Type[T], id: UUID | str, db: Session, expunge: bool = False, lookup_column: str = "id" +) -> T: obj = db.query(db_class).filter(getattr(db_class, lookup_column) == id).one_or_none() if obj is None: raise HTTPException(status_code=404, detail="The object does not exist.")