mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
fix: Update redirect keys in wizard functions and add next_step to form data
This commit is contained in:
@@ -328,7 +328,7 @@ def wizard_cancel():
|
||||
remove_pending_job(pending_id)
|
||||
|
||||
if wants_wizard_json():
|
||||
return jsonify({"status": "cancelled", "redirect": url_for("main.index")})
|
||||
return jsonify({"status": "cancelled", "redirect_url": url_for("main.index")})
|
||||
|
||||
return redirect(url_for("main.index"))
|
||||
|
||||
@@ -356,7 +356,7 @@ def wizard_finish():
|
||||
return jsonify({
|
||||
"status": "submitted",
|
||||
"job_id": job_id,
|
||||
"redirect": url_for("main.index"),
|
||||
"redirect_url": url_for("main.index"),
|
||||
"jobs_panel": render_jobs_panel()
|
||||
})
|
||||
|
||||
|
||||
@@ -326,6 +326,7 @@ const submitWizardForm = async (form, submitter) => {
|
||||
const formData = new FormData(form);
|
||||
if (normalizedStepTarget) {
|
||||
formData.set("active_step", normalizedStepTarget);
|
||||
formData.set("next_step", normalizedStepTarget);
|
||||
}
|
||||
if (submitter && submitter.name && !formData.has(submitter.name)) {
|
||||
formData.append(submitter.name, submitter.value ?? "");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<form method="post"
|
||||
action="{{ url_for('main.wizard_finish', pending_id=pending.id) }}"
|
||||
action="{{ url_for('main.wizard_update', pending_id=pending.id) }}"
|
||||
class="prepare-form"
|
||||
id="prepare-form"
|
||||
data-role="prepare-form"
|
||||
@@ -7,6 +7,7 @@
|
||||
data-step="chapters"
|
||||
data-pending-id="{{ pending.id }}"
|
||||
data-analyze-url="{{ url_for('main.wizard_update', pending_id=pending.id) }}">
|
||||
<input type="hidden" name="step" value="chapters">
|
||||
<input type="hidden" name="active_step" value="chapters" data-role="active-step-input">
|
||||
<div class="wizard-hidden-inputs" aria-hidden="true">
|
||||
<input type="hidden" name="chunk_level" value="{{ pending.chunk_level }}">
|
||||
|
||||
Reference in New Issue
Block a user