From 16abb636c5d1f126a12e27f7f0cdbb02f06d6d5b Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 2 Jan 2023 16:17:28 +0000 Subject: [PATCH] Show message on draft packages rather than 404 --- app/blueprints/packages/packages.py | 3 --- app/templates/packages/gone.html | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/blueprints/packages/packages.py b/app/blueprints/packages/packages.py index dbace6d7..c6c20a76 100644 --- a/app/blueprints/packages/packages.py +++ b/app/blueprints/packages/packages.py @@ -117,9 +117,6 @@ def getReleases(package): @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 ( diff --git a/app/templates/packages/gone.html b/app/templates/packages/gone.html index aa0919a5..690e7a9c 100644 --- a/app/templates/packages/gone.html +++ b/app/templates/packages/gone.html @@ -26,6 +26,11 @@

{{ _("This package is currently undergoing review") }}

+ {% elif package.state.name == "WIP" %} +

{{ _("Package Not Yet Submitted") }}

+

+ {{ _("This package has been created but hasn't been submitted for approval yet.") }} +

{% else %}

{{ _("Package Undergoing Review") }}