fix: 2 low findings from audit — consistent 500 match source, accurate return type

Use full_body for the 500 'could not process' permanent-rejection check,
consistent with the 400 'face' check on the line above. error_detail is
truncated to 100 chars via the fallback path, which could silently miss
the phrase in a long response body.

Remove | None from process_face_mode return type — every code path returns
tuple[int,int] or str; None is unreachable. Update docstring to match.
This commit is contained in:
2026-06-17 17:47:31 +00:00
parent 86caffc8d7
commit 5e0a871314
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -573,7 +573,7 @@ def upload_to_frigate(jobs: list[dict]) -> None:
_is_permanent = (
(resp.status_code == 400 and "face" in full_body.lower())
or resp.status_code == 422
or (resp.status_code == 500 and "could not process" in error_detail.lower())
or (resp.status_code == 500 and "could not process" in full_body.lower())
)
if _is_permanent:
asset_id = asset_map.get(fname)