fix: ruff lint + format fixes in tests, ESLint fixes in frontend
This commit is contained in:
@@ -80,7 +80,9 @@ def generate_retouch_prompt(vehicle_info: dict[str, Any] | None = None) -> str:
|
||||
if make and model:
|
||||
parts.append(f"The vehicle is a {make} {model}.")
|
||||
if color:
|
||||
parts.append(f"The vehicle color is {color}; ensure it looks accurate and rich.")
|
||||
parts.append(
|
||||
f"The vehicle color is {color}; ensure it looks accurate and rich."
|
||||
)
|
||||
return " ".join(parts)
|
||||
|
||||
return base_prompt
|
||||
@@ -98,7 +100,9 @@ async def upload_retouch_file(
|
||||
Raises ValueError for invalid MIME type or file size.
|
||||
"""
|
||||
if not validate_mime_type(mime_type):
|
||||
raise ValueError(f"Invalid MIME type: {mime_type}. Only image/* types are allowed.")
|
||||
raise ValueError(
|
||||
f"Invalid MIME type: {mime_type}. Only image/* types are allowed."
|
||||
)
|
||||
|
||||
if not validate_file_size(len(file_bytes)):
|
||||
raise ValueError(f"File size exceeds limit of {settings.MAX_FILE_SIZE_MB} MB")
|
||||
@@ -151,7 +155,11 @@ async def list_results(
|
||||
total = total_result.scalar_one()
|
||||
|
||||
offset = (page - 1) * page_size
|
||||
data_stmt = data_stmt.order_by(RetouchResult.created_at.desc()).offset(offset).limit(page_size)
|
||||
data_stmt = (
|
||||
data_stmt.order_by(RetouchResult.created_at.desc())
|
||||
.offset(offset)
|
||||
.limit(page_size)
|
||||
)
|
||||
result = await db.execute(data_stmt)
|
||||
items = list(result.scalars().all())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user