fix: resolve broken imports and argument mismatch in API handlers

- Move utils imports to module-level with try/except for relative
  (ComfyUI) and absolute (test runner) import contexts in prompts.py.
  Fixes 500 errors on rating update, prompt save, and prompt edit.
- Add missing None for rating parameter in image scan's save_prompt
  call, which was passing the notes string as rating causing a type
  comparison error during image scanning.
This commit is contained in:
Vito Sansevero
2026-02-08 08:48:17 -08:00
parent 0e527fd80a
commit 9e8864e453
2 changed files with 20 additions and 14 deletions
+1
View File
@@ -1065,6 +1065,7 @@ class AdminRoutesMixin:
prompt_text.strip(),
"scanned",
["auto-scanned"],
None,
f"Auto-scanned from {os.path.basename(png_file)}",
prompt_hash,
)