diff --git a/app/blueprints/packages/packages.py b/app/blueprints/packages/packages.py index 53421d72..b9da2888 100644 --- a/app/blueprints/packages/packages.py +++ b/app/blueprints/packages/packages.py @@ -322,6 +322,8 @@ def create_edit(author=None, name=None): package = None if author is None: form = PackageForm(formdata=request.form) + form.submit.label.text = lazy_gettext("Save draft") + author = request.args.get("author") if author is None or author == current_user.username: author = current_user @@ -340,7 +342,7 @@ def create_edit(author=None, name=None): if package is None: abort(404) if not package.check_perm(current_user, Permission.EDIT_PACKAGE): - return redirect(package.get_url("packages.view")) + abort(403) author = package.author diff --git a/app/templates/packages/create_edit.html b/app/templates/packages/create_edit.html index af795f35..d0d2c66b 100644 --- a/app/templates/packages/create_edit.html +++ b/app/templates/packages/create_edit.html @@ -86,7 +86,7 @@ {{ render_field(form.desc, class_="pkg_meta", fieldclass="form-control markdown") }} -
+
{{ _("Repository and Links") }}
@@ -122,6 +122,12 @@ {{ render_field(form.translation_url, class_="pkg_meta", hint=_("How can users translate your package? ie: weblate URL or a help page")) }}
-
{{ render_submit_field(form.submit) }}
+ {% if not package %} +

+ {{ _("You need to save a draft before you can add releases and screenshots. You'll be able to edit the package again before submitting for approval.") }} +

+ {% endif %} + +
{{ render_submit_field(form.submit) }}
{% endblock %}