Compare commits

...
Author SHA1 Message Date
Andrew BeveridgeandClaude Opus 4.5 ef48b726d8 fix: admin reset endpoint always returned 500 due to None check bug
The reset endpoint was checking `if not success:` but update_job()
returns None (not a boolean). Since `not None` is True, this always
raised a 500 error.

Removed the erroneous check - update_job() raises exceptions on failure,
so the return value doesn't need to be checked.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 15:35:06 -08:00
+2 -8
View File
@@ -1146,14 +1146,8 @@ async def reset_job(
}
# Perform the update with state_data clearing
# We need to set the cleared keys to DELETE_FIELD
success = job_manager.update_job(job_id, updates)
if not success:
raise HTTPException(
status_code=500,
detail="Failed to reset job. Please try again."
)
# Note: update_job() raises exceptions on failure, returns None on success
job_manager.update_job(job_id, updates)
# Clear the state data keys and error state using direct Firestore update
from google.cloud.firestore_v1 import DELETE_FIELD, ArrayUnion