fix error with rule regex doesn't save if error

This commit is contained in:
Son Nguyen Kim 2021-09-21 10:42:32 +02:00
parent 1e3afa257c
commit 84880ae32a
1 changed files with 6 additions and 6 deletions

View File

@ -504,6 +504,12 @@ def domain_detail_auto_create(custom_domain_id):
AutoCreateRule.delete(rule_id)
db.session.commit()
flash(f"Rule #{rule_order} has been deleted", "success")
return redirect(
url_for(
"dashboard.domain_detail_auto_create",
custom_domain_id=custom_domain.id,
)
)
elif request.form.get("form-name") == "test-auto-create-rule":
if auto_create_test_form.validate():
local = auto_create_test_form.local.data
@ -527,10 +533,4 @@ def domain_detail_auto_create(custom_domain_id):
"dashboard/domain_detail/auto-create.html", **locals()
)
return redirect(
url_for(
"dashboard.domain_detail_auto_create", custom_domain_id=custom_domain.id
)
)
return render_template("dashboard/domain_detail/auto-create.html", **locals())