Add HTML5 import preflight check
This commit is contained in:
@@ -40,6 +40,7 @@ from api_server.html5 import (
|
||||
render_html5_index,
|
||||
render_html5_project_setup,
|
||||
render_html5_project_rows,
|
||||
render_html5_import_check,
|
||||
render_html5_setup_summary,
|
||||
render_html5_source,
|
||||
render_html5_status,
|
||||
@@ -1692,6 +1693,17 @@ async def html5_project_setup_source(project_id: str, request: Request) -> Respo
|
||||
)
|
||||
|
||||
|
||||
@app.post("/html5/projects/{project_id}/setup/check")
|
||||
async def html5_project_setup_check(project_id: str, request: Request) -> Response:
|
||||
form = await _html5_form_data(request)
|
||||
source = ImportSourceKind(_form_value(form, "source") or _current_import_source(project_id).value)
|
||||
check = _import_check_response(project_id, source, ImportRequest(source=source))
|
||||
return Response(
|
||||
render_html5_import_check(project_id, check),
|
||||
media_type="text/html; charset=utf-8",
|
||||
)
|
||||
|
||||
|
||||
@app.post("/html5/projects/{project_id}/setup/import")
|
||||
async def html5_project_setup_import(project_id: str, request: Request) -> Response:
|
||||
form = await _html5_form_data(request)
|
||||
|
||||
Reference in New Issue
Block a user