mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-10 01:23:48 +01:00
Add automatic approval of releases and screenshots
This commit is contained in:
parent
36f9572cbb
commit
bafd426eaf
@ -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 {}" \
|
||||
|
Loading…
Reference in New Issue
Block a user