fix: normalize unicode escape sequences and reformat multi-line expressions across codebase

This commit is contained in:
2026-06-09 16:48:08 +00:00
parent 66dfda88bc
commit c4f2937415
175 changed files with 12660 additions and 4175 deletions
+14 -4
View File
@@ -4,7 +4,11 @@ from fastapi import APIRouter, Request
from fastapi.responses import JSONResponse
from devplacepy.database import get_table, get_int_setting
from devplacepy.utils import require_user_api
from devplacepy.attachments import store_attachment, delete_attachment as _delete_attachment, is_extension_allowed
from devplacepy.attachments import (
store_attachment,
delete_attachment as _delete_attachment,
is_extension_allowed,
)
logger = logging.getLogger(__name__)
router = APIRouter()
@@ -21,7 +25,9 @@ async def upload_file(request: Request):
ext = Path(file.filename).suffix.lower()
if not is_extension_allowed(ext):
return JSONResponse({"error": f"File type '{ext}' not allowed"}, status_code=415)
return JSONResponse(
{"error": f"File type '{ext}' not allowed"}, status_code=415
)
try:
content = await file.read()
@@ -32,9 +38,13 @@ async def upload_file(request: Request):
result = store_attachment(content, file.filename, user["uid"])
if result is None:
max_size_mb = get_int_setting("max_upload_size_mb", 10)
return JSONResponse({"error": f"File exceeds {max_size_mb}MB limit"}, status_code=413)
return JSONResponse(
{"error": f"File exceeds {max_size_mb}MB limit"}, status_code=413
)
logger.info(f"File uploaded: {file.filename} ({len(content)} bytes) -> {result['url']}")
logger.info(
f"File uploaded: {file.filename} ({len(content)} bytes) -> {result['url']}"
)
return JSONResponse(result, status_code=201)