mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 14:02:24 +01:00
Require package authors to have an email address
This commit is contained in:
parent
a83d3bdbe7
commit
76638ad878
@ -349,6 +349,10 @@ def handle_create_edit(package: typing.Optional[Package], form: PackageForm, aut
|
||||
@bp.route("/packages/<author>/<name>/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)
|
||||
|
@ -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"))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user