Reformatting everything with black
This commit is contained in:
1 parent
7bd07f084a
commit
8185f1f8b3
48 files changed
+1000
-348
No files matched your search
+24
-7
@@ -34,9 +34,14 @@ async def create_iso_thread(
|
||||
depth_mm=payload.depth_mm,
|
||||
)
|
||||
await audit_crud.log(
|
||||
db, actor=actor, action="create", resource_type="IsoThread",
|
||||
db,
|
||||
actor=actor,
|
||||
action="create",
|
||||
resource_type="IsoThread",
|
||||
resource_id=thread.id,
|
||||
description=audit_crud.describe_create("IsoThread", thread.id, f"M{thread.diameter_mm}×{thread.pitch_mm}"),
|
||||
description=audit_crud.describe_create(
|
||||
"IsoThread", thread.id, f"M{thread.diameter_mm}×{thread.pitch_mm}"
|
||||
),
|
||||
)
|
||||
return thread
|
||||
|
||||
@@ -49,7 +54,9 @@ async def get_iso_thread(
|
||||
):
|
||||
thread = await iso_thread_crud.get(db, iso_thread_id)
|
||||
if thread is None:
|
||||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="ISO thread not found")
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND, detail="ISO thread not found"
|
||||
)
|
||||
return thread
|
||||
|
||||
|
||||
@@ -62,11 +69,16 @@ async def update_iso_thread(
|
||||
):
|
||||
thread = await iso_thread_crud.get(db, iso_thread_id)
|
||||
if thread is None:
|
||||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="ISO thread not found")
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND, detail="ISO thread not found"
|
||||
)
|
||||
changes = payload.model_dump(exclude_unset=True)
|
||||
thread = await iso_thread_crud.update(db, thread, changes)
|
||||
await audit_crud.log(
|
||||
db, actor=actor, action="update", resource_type="IsoThread",
|
||||
db,
|
||||
actor=actor,
|
||||
action="update",
|
||||
resource_type="IsoThread",
|
||||
resource_id=thread.id,
|
||||
description=audit_crud.describe_update("IsoThread", thread.id, changes),
|
||||
)
|
||||
@@ -81,11 +93,16 @@ async def delete_iso_thread(
|
||||
):
|
||||
thread = await iso_thread_crud.get(db, iso_thread_id)
|
||||
if thread is None:
|
||||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="ISO thread not found")
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND, detail="ISO thread not found"
|
||||
)
|
||||
name = f"M{thread.diameter_mm}×{thread.pitch_mm}"
|
||||
await iso_thread_crud.delete(db, thread)
|
||||
await audit_crud.log(
|
||||
db, actor=actor, action="delete", resource_type="IsoThread",
|
||||
db,
|
||||
actor=actor,
|
||||
action="delete",
|
||||
resource_type="IsoThread",
|
||||
resource_id=iso_thread_id,
|
||||
description=audit_crud.describe_delete("IsoThread", iso_thread_id, name),
|
||||
)
|
||||
Reference in new issue
Block a user