Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 14, 2024
1 parent 75e3e25 commit 94c5e02
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/backend/app/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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:
Expand Down

0 comments on commit 94c5e02

Please sign in to comment.