Fix wizard showing after validation error

This commit is contained in:
rubenwardy 2018-05-24 01:04:25 +01:00
parent f809cdcab0
commit 7bbb480ae2
No known key found for this signature in database
GPG Key ID: A1E29D52FF81513C
2 changed files with 4 additions and 2 deletions

View File

@ -47,7 +47,7 @@
<div class="pkg_meta">{{ render_submit_field(form.submit) }}</div>
</form>
{% if not package.title %}
{% if enable_wizard %}
<script src="/static/jquery.min.js"></script>
<script src="/static/url.min.js"></script>
<script src="/static/polltask.js"></script>

View File

@ -191,7 +191,9 @@ def create_edit_package_page(author=None, name=None):
return redirect(package.getDetailsURL())
return render_template("packages/create_edit.html", package=package, form=form, author=author)
enableWizard = name is None and request.method != "POST"
return render_template("packages/create_edit.html", package=package, \
form=form, author=author, enable_wizard=enableWizard)
@app.route("/packages/<author>/<name>/approve/", methods=["POST"])
@login_required