Skip to content

Commit 664bcd2

Browse files
amyfromandigithub-actions[bot]
authored andcommitted
Format code and sort imports
1 parent b520a83 commit 664bcd2

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

services/api-v3/api/routes/object.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import starlette.requests
77
from api.database import get_async_session, get_engine
88
from api.routes.security import has_access
9+
from api.settings import settings
910
from fastapi import (
1011
APIRouter,
1112
Depends,
@@ -18,7 +19,6 @@
1819
from minio import Minio
1920
from sqlalchemy import text
2021
from starlette.datastructures import UploadFile as StarletteUploadFile
21-
from api.settings import settings
2222

2323
router = APIRouter(
2424
prefix="/object",
@@ -49,6 +49,7 @@ def sha256_of_uploadfile(
4949
upload.file.seek(0)
5050
return h.hexdigest()
5151

52+
5253
def get_s3_client():
5354
# TODO need to add or configure these envs within api v3 kubernetes config
5455
return Minio(
@@ -58,6 +59,7 @@ def get_s3_client():
5859
secure=settings.s3_secure,
5960
)
6061

62+
6163
def get_storage_host_bucket() -> tuple[str, str]:
6264
"""
6365
Keep host/bucket consistent everywhere.
@@ -191,7 +193,6 @@ async def list_objects(
191193
return {"items": items, "next_before_id": next_before_id}
192194

193195

194-
195196
@router.get("/{id}")
196197
async def get_object(id: int):
197198
engine = get_engine()
@@ -406,6 +407,7 @@ async def delete_object(
406407
await session.commit()
407408
return {"status": "deleted", "hard": False, "object": _row_to_dict(row2)}
408409

410+
409411
@router.post("/{id}/track")
410412
async def track_object(id: int):
411413
"""
@@ -421,10 +423,10 @@ async def forget_object(id: int):
421423
"""
422424
raise HTTPException(status_code=501, detail="Forget not implemented yet")
423425

426+
424427
@router.get("/{id}/url")
425428
async def get_object_url(id: int):
426429
"""
427430
TODO: Return or redirect to signed S3 URL.
428431
"""
429432
raise HTTPException(status_code=501, detail="URL helper not implemented yet")
430-

uv.lock

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)