From 94c5e02a9c23f65e992260b64a8ed8760b732a73 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 06:41:55 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/backend/app/db/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/app/db/models.py b/src/backend/app/db/models.py index 907c8bff93..f28bc7cf27 100644 --- a/src/backend/app/db/models.py +++ b/src/backend/app/db/models.py @@ -32,8 +32,8 @@ from fastapi import HTTPException, UploadFile from loguru import logger as log from psycopg import Connection -from psycopg.rows import class_row from psycopg.errors import UniqueViolation +from psycopg.rows import class_row from pydantic import AwareDatetime, BaseModel, Field, ValidationInfo from pydantic.functional_validators import field_validator @@ -409,12 +409,12 @@ async def create( {'ON CONFLICT ("name") DO NOTHING' if ignore_conflict else ''} RETURNING *; """ - + try: async with db.cursor(row_factory=class_row(cls)) as cur: await cur.execute(sql, model_dump) new_org = await cur.fetchone() - + if new_org and new_org.logo is None and new_logo: from app.organisations.organisation_schemas import OrganisationUpdate @@ -427,7 +427,7 @@ async def create( log.error(f"Organisation named ({org_in.name}) already exists!") raise HTTPException( status_code=HTTPStatus.CONFLICT, - detail=f"Organisation named ({org_in.name}) already exists!" + detail=f"Organisation named ({org_in.name}) already exists!", ) from e except Exception as e: