Fix screenshot approval checkbox always being unchecked

Fixes #212
This commit is contained in:
rubenwardy 2020-07-10 22:19:47 +01:00
parent 0bf61dda08
commit 1d8abd8f4b
2 changed files with 6 additions and 1 deletions

@ -167,8 +167,8 @@ def edit_release(package, id):
# Initial form class from post data and default data
form = EditPackageReleaseForm(formdata=request.form, obj=release)
# HACK: fix bug in wtforms
if request.method == "GET":
# HACK: fix bug in wtforms
form.approved.data = release.approved
if request.method == "POST" and form.validate():

@ -85,6 +85,11 @@ def edit_screenshot(package, id):
# Initial form class from post data and default data
form = EditScreenshotForm(formdata=request.form, obj=screenshot)
if request.method == "GET":
# HACK: fix bug in wtforms
form.approved.data = screenshot.approved
if request.method == "POST" and form.validate():
if canEdit and form["delete"].data:
PackageScreenshot.query.filter_by(id=id).delete()