Fix unapproved packages appearing in collections

This commit is contained in:
rubenwardy
2023-08-16 01:00:51 +01:00
parent f470357a42
commit ea2f1f4f6f
5 changed files with 21 additions and 8 deletions

View File

@@ -130,7 +130,7 @@ def user_redirect(author):
@bp.route("/packages/<author>/<name>/")
@is_package_page
def view(package):
if package.state != PackageState.APPROVED and not package.check_perm(current_user, Permission.EDIT_PACKAGE):
if not package.check_perm(current_user, Permission.VIEW_PACKAGE):
return render_template("packages/gone.html", package=package), 403
show_similar = not package.approved and (