Disable email requirement for admins
This commit is contained in:
@@ -325,7 +325,7 @@ def handle_create_edit(package: typing.Optional[Package], form: PackageForm, aut
|
|||||||
@bp.route("/packages/<author>/<name>/edit/", methods=["GET", "POST"])
|
@bp.route("/packages/<author>/<name>/edit/", methods=["GET", "POST"])
|
||||||
@login_required
|
@login_required
|
||||||
def create_edit(author=None, name=None):
|
def create_edit(author=None, name=None):
|
||||||
if current_user.email is None:
|
if current_user.email is None and not current_user.rank.at_least(UserRank.ADMIN):
|
||||||
flash(gettext("You must add an email address to your account and confirm it before you can manage packages"), "danger")
|
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"))
|
return redirect(url_for("users.email_notifications"))
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class EditPackageReleaseForm(FlaskForm):
|
|||||||
@login_required
|
@login_required
|
||||||
@is_package_page
|
@is_package_page
|
||||||
def create_release(package):
|
def create_release(package):
|
||||||
if current_user.email is None:
|
if current_user.email is None and not current_user.rank.at_least(UserRank.ADMIN):
|
||||||
flash(gettext("You must add an email address to your account and confirm it before you can manage packages"), "danger")
|
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"))
|
return redirect(url_for("users.email_notifications"))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user