diff --git a/app/blueprints/packages/packages.py b/app/blueprints/packages/packages.py index c71f75f1..0f4da99a 100644 --- a/app/blueprints/packages/packages.py +++ b/app/blueprints/packages/packages.py @@ -349,6 +349,10 @@ def handle_create_edit(package: typing.Optional[Package], form: PackageForm, aut @bp.route("/packages///edit/", methods=["GET", "POST"]) @login_required def create_edit(author=None, name=None): + if current_user.email is None: + flash(gettext("You must add an email address to your account and confirm it before you can manage packages"), "danger") + return redirect(url_for("users.email_notifications")) + package = None if author is None: form = PackageForm(formdata=request.form) diff --git a/app/blueprints/packages/releases.py b/app/blueprints/packages/releases.py index f6e15fef..3ce0958f 100644 --- a/app/blueprints/packages/releases.py +++ b/app/blueprints/packages/releases.py @@ -78,6 +78,10 @@ class EditPackageReleaseForm(FlaskForm): @login_required @is_package_page def create_release(package): + if current_user.email is None: + flash(gettext("You must add an email address to your account and confirm it before you can manage packages"), "danger") + return redirect(url_for("users.email_notifications")) + if not package.check_perm(current_user, Permission.MAKE_RELEASE): return redirect(package.get_url("packages.view"))