mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-20 10:23:12 +00:00
Fix template shown when confirming send an email
This commit is contained in:
parent
c76d5c7102
commit
fca81fe906
1 changed files with 12 additions and 15 deletions
|
@ -1032,25 +1032,22 @@ def process_passwd(request, req):
|
||||||
|
|
||||||
|
|
||||||
def resend_confirmation_email(request, userid):
|
def resend_confirmation_email(request, userid):
|
||||||
""" Renvoie du mail de confirmation """
|
""" Renvoi du mail de confirmation """
|
||||||
try:
|
if request.method == "POST":
|
||||||
user = User.objects.get(
|
try:
|
||||||
id=userid,
|
user = User.objects.get(
|
||||||
state__in=[User.STATE_EMAIL_NOT_YET_CONFIRMED],
|
id=userid,
|
||||||
)
|
state__in=[User.STATE_EMAIL_NOT_YET_CONFIRMED],
|
||||||
except User.DoesNotExist:
|
)
|
||||||
messages.error(request, _("The user doesn't exist."))
|
user.confirm_email_address_mail(request)
|
||||||
return redirect(reverse("users:profil", kwargs={"userid": userid}))
|
messages.success(request, _("An email to confirm your address was sent."))
|
||||||
|
except User.DoesNotExist:
|
||||||
|
messages.error(request, _("The user doesn't exist."))
|
||||||
|
|
||||||
if userform.is_valid():
|
|
||||||
user.confirm_email_address_mail(request)
|
|
||||||
messages.success(request, _("An email to confirm your address was sent."))
|
|
||||||
return redirect(reverse("users:profil", kwargs={"userid": userid}))
|
return redirect(reverse("users:profil", kwargs={"userid": userid}))
|
||||||
|
|
||||||
return form(
|
return form(
|
||||||
{"email": user.email},
|
{"email": user.email}, "users/resend_confirmation_email.html", request
|
||||||
"users/resend_confirmation_email.html",
|
|
||||||
request,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue