Reformatting everything with black

This commit is contained in:
Ian Roddis committed 2026-07-14 14:36:49 -03:00
1 parent 7bd07f084a
commit 8185f1f8b3
48 files changed
+1000 -348

No files matched your search

+26 -7
View File
@@ -35,9 +35,16 @@ async def create_unc_thread(
depth_in=payload.depth_in,
)
await audit_crud.log(
db, actor=actor, action="create", resource_type="UncThread",
db,
actor=actor,
action="create",
resource_type="UncThread",
resource_id=thread.id,
description=audit_crud.describe_create("UncThread", thread.id, f"{thread.diameter_fraction}-{thread.tpi} {thread.series.value}"),
description=audit_crud.describe_create(
"UncThread",
thread.id,
f"{thread.diameter_fraction}-{thread.tpi} {thread.series.value}",
),
)
return thread
@@ -50,7 +57,9 @@ async def get_unc_thread(
):
thread = await unc_thread_crud.get(db, unc_thread_id)
if thread is None:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="UNC thread not found")
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND, detail="UNC thread not found"
)
return thread
@@ -63,11 +72,16 @@ async def update_unc_thread(
):
thread = await unc_thread_crud.get(db, unc_thread_id)
if thread is None:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="UNC thread not found")
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND, detail="UNC thread not found"
)
changes = payload.model_dump(exclude_unset=True)
thread = await unc_thread_crud.update(db, thread, changes)
await audit_crud.log(
db, actor=actor, action="update", resource_type="UncThread",
db,
actor=actor,
action="update",
resource_type="UncThread",
resource_id=thread.id,
description=audit_crud.describe_update("UncThread", thread.id, changes),
)
@@ -82,11 +96,16 @@ async def delete_unc_thread(
):
thread = await unc_thread_crud.get(db, unc_thread_id)
if thread is None:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="UNC thread not found")
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND, detail="UNC thread not found"
)
name = f"{thread.diameter_fraction}-{thread.tpi} {thread.series.value}"
await unc_thread_crud.delete(db, thread)
await audit_crud.log(
db, actor=actor, action="delete", resource_type="UncThread",
db,
actor=actor,
action="delete",
resource_type="UncThread",
resource_id=unc_thread_id,
description=audit_crud.describe_delete("UncThread", unc_thread_id, name),
)