mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-20 10:23:12 +00:00
Fix user referenced before assignment
This commit is contained in:
parent
fca81fe906
commit
4322540077
1 changed files with 10 additions and 10 deletions
|
@ -1033,17 +1033,17 @@ def process_passwd(request, req):
|
||||||
|
|
||||||
def resend_confirmation_email(request, userid):
|
def resend_confirmation_email(request, userid):
|
||||||
""" Renvoi du mail de confirmation """
|
""" Renvoi du mail de confirmation """
|
||||||
if request.method == "POST":
|
|
||||||
try:
|
try:
|
||||||
user = User.objects.get(
|
user = User.objects.get(
|
||||||
id=userid,
|
id=userid,
|
||||||
state__in=[User.STATE_EMAIL_NOT_YET_CONFIRMED],
|
state__in=[User.STATE_EMAIL_NOT_YET_CONFIRMED],
|
||||||
)
|
)
|
||||||
user.confirm_email_address_mail(request)
|
|
||||||
messages.success(request, _("An email to confirm your address was sent."))
|
|
||||||
except User.DoesNotExist:
|
except User.DoesNotExist:
|
||||||
messages.error(request, _("The user doesn't exist."))
|
messages.error(request, _("The user doesn't exist."))
|
||||||
|
|
||||||
|
if request.method == "POST":
|
||||||
|
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(
|
||||||
|
|
Loading…
Reference in a new issue