mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-01 07:34:37 +00:00
Require user_edit permission to resend confirmation email
This commit is contained in:
parent
67b03827df
commit
04969abed3
1 changed files with 22 additions and 21 deletions
|
@ -1030,6 +1030,28 @@ def process_passwd(request, req):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def process_email(request, req):
|
||||||
|
"""Process la confirmation de mail, renvoie le formulaire
|
||||||
|
de validation"""
|
||||||
|
user = req.user
|
||||||
|
if request.method == "POST":
|
||||||
|
with transaction.atomic(), reversion.create_revision():
|
||||||
|
user.confirm_mail()
|
||||||
|
user.save()
|
||||||
|
reversion.set_comment("Email confirmation")
|
||||||
|
|
||||||
|
req.delete()
|
||||||
|
messages.success(request, _("The %s address was confirmed." % user.email))
|
||||||
|
return redirect(reverse("index"))
|
||||||
|
|
||||||
|
return form(
|
||||||
|
{"email": user.email, "firstname": user.name, "lastname": user.surname},
|
||||||
|
"users/confirm_email.html",
|
||||||
|
request
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@can_edit(User)
|
||||||
def resend_confirmation_email(request, userid):
|
def resend_confirmation_email(request, userid):
|
||||||
""" Renvoi du mail de confirmation """
|
""" Renvoi du mail de confirmation """
|
||||||
try:
|
try:
|
||||||
|
@ -1052,27 +1074,6 @@ def resend_confirmation_email(request, userid):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def process_email(request, req):
|
|
||||||
"""Process la confirmation de mail, renvoie le formulaire
|
|
||||||
de validation"""
|
|
||||||
user = req.user
|
|
||||||
if request.method == "POST":
|
|
||||||
with transaction.atomic(), reversion.create_revision():
|
|
||||||
user.confirm_mail()
|
|
||||||
user.save()
|
|
||||||
reversion.set_comment("Email confirmation")
|
|
||||||
|
|
||||||
req.delete()
|
|
||||||
messages.success(request, _("The %s address was confirmed." % user.email))
|
|
||||||
return redirect(reverse("index"))
|
|
||||||
|
|
||||||
return form(
|
|
||||||
{"email": user.email, "firstname": user.name, "lastname": user.surname},
|
|
||||||
"users/confirm_email.html",
|
|
||||||
request
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def initial_register(request):
|
def initial_register(request):
|
||||||
switch_ip = request.GET.get("switch_ip", None)
|
switch_ip = request.GET.get("switch_ip", None)
|
||||||
|
|
Loading…
Reference in a new issue