Add automatic approval of releases and screenshots

This commit is contained in:
rubenwardy 2019-01-29 18:30:30 +00:00
parent 36f9572cbb
commit bafd426eaf
2 changed files with 6 additions and 3 deletions

@ -85,6 +85,7 @@ def create_release_page(package):
rel.task_id = uuid()
rel.min_rel = form["min_rel"].data.getActual()
rel.max_rel = form["max_rel"].data.getActual()
rel.approved = package.checkPerm(current_user, Permission.APPROVE_RELEASE)
db.session.add(rel)
db.session.commit()
@ -104,6 +105,7 @@ def create_release_page(package):
rel.url = uploadedPath
rel.min_rel = form["min_rel"].data.getActual()
rel.max_rel = form["max_rel"].data.getActual()
rel.approved = package.checkPerm(current_user, Permission.APPROVE_RELEASE)
db.session.add(rel)
db.session.commit()

@ -53,9 +53,10 @@ def create_screenshot_page(package, id=None):
"a PNG or JPG image file")
if uploadedPath is not None:
ss = PackageScreenshot()
ss.package = package
ss.title = form["title"].data or "Untitled"
ss.url = uploadedPath
ss.package = package
ss.title = form["title"].data or "Untitled"
ss.url = uploadedPath
ss.approved = package.checkPerm(current_user, Permission.APPROVE_SCREENSHOT)
db.session.add(ss)
msg = "{}: Screenshot added {}" \