Fix being able to see unpublished packages
This commit is contained in:
@@ -116,6 +116,12 @@ def getReleases(package):
|
||||
@bp.route("/packages/<author>/<name>/")
|
||||
@is_package_page
|
||||
def view(package):
|
||||
if package.state != PackageState.APPROVED and not package.checkPerm(current_user, Permission.EDIT_PACKAGE):
|
||||
if package.state == PackageState.WIP:
|
||||
abort(404)
|
||||
|
||||
return render_template("packages/gone.html", package=package), 503
|
||||
|
||||
show_similar = not package.approved and (
|
||||
current_user in package.maintainers or
|
||||
package.checkPerm(current_user, Permission.APPROVE_NEW))
|
||||
|
||||
Reference in New Issue
Block a user