mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 22:12: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"])
|
@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:
|
||||||
|
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
|
package = None
|
||||||
if author is None:
|
if author is None:
|
||||||
form = PackageForm(formdata=request.form)
|
form = PackageForm(formdata=request.form)
|
||||||
|
@ -78,6 +78,10 @@ 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:
|
||||||
|
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):
|
if not package.check_perm(current_user, Permission.MAKE_RELEASE):
|
||||||
return redirect(package.get_url("packages.view"))
|
return redirect(package.get_url("packages.view"))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user