mirror of
https://github.com/blw1138/cross-py-builder.git
synced 2026-09-07 21:41:09 -05:00
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:
+1
-1
@@ -103,7 +103,7 @@ def api_create_job():
|
||||
job_id = db.create_job("upload", fname, os_req, cpu_req)
|
||||
else:
|
||||
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:
|
||||
return jsonify({"error": "Provide a file upload or a repo_url"}), 400
|
||||
job_id = db.create_job("git", repo_url, os_req, cpu_req)
|
||||
|
||||
Reference in New Issue
Block a user