Read repo_url from multipart form in job creation

The web UI submits jobs as FormData, so request.get_json() was always
None and the repo_url was never seen.
This commit is contained in:
Brett Williams
2026-08-31 00:42:11 -05:00
parent aab0c9b12d
commit cde111e584
+1 -1
View File
@@ -103,7 +103,7 @@ def api_create_job():
job_id = db.create_job("upload", fname, os_req, cpu_req) job_id = db.create_job("upload", fname, os_req, cpu_req)
else: else:
data = request.get_json(silent=True) or {} data = request.get_json(silent=True) or {}
repo_url = (data.get("repo_url") or "").strip() repo_url = (data.get("repo_url") or request.form.get("repo_url") or "").strip()
if not repo_url: if not repo_url:
return jsonify({"error": "Provide a file upload or a repo_url"}), 400 return jsonify({"error": "Provide a file upload or a repo_url"}), 400
job_id = db.create_job("git", repo_url, os_req, cpu_req) job_id = db.create_job("git", repo_url, os_req, cpu_req)