Show message on draft packages rather than 404

This commit is contained in:
rubenwardy 2023-01-02 16:17:28 +00:00
parent a7e6f19ae6
commit 16abb636c5
2 changed files with 5 additions and 3 deletions

@ -117,9 +117,6 @@ def getReleases(package):
@is_package_page @is_package_page
def view(package): def view(package):
if package.state != PackageState.APPROVED and not package.checkPerm(current_user, Permission.EDIT_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 return render_template("packages/gone.html", package=package), 503
show_similar = not package.approved and ( show_similar = not package.approved and (

@ -26,6 +26,11 @@
<p> <p>
{{ _("This package is currently undergoing review") }} {{ _("This package is currently undergoing review") }}
</p> </p>
{% elif package.state.name == "WIP" %}
<h1>{{ _("Package Not Yet Submitted") }}</h1>
<p>
{{ _("This package has been created but hasn't been submitted for approval yet.") }}
</p>
{% else %} {% else %}
<h1>{{ _("Package Undergoing Review") }}</h1> <h1>{{ _("Package Undergoing Review") }}</h1>
<p> <p>