mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-27 07:02:26 +00:00
Allow users in the STATE_EMAIL_NOT_YET_CONFIRMED to reset their password
This commit is contained in:
parent
14fe70c762
commit
811e527232
2 changed files with 2 additions and 1 deletions
|
@ -113,6 +113,7 @@ class PassForm(FormRevMixin, FieldPermissionFormMixin, forms.ModelForm):
|
||||||
"""Changement du mot de passe"""
|
"""Changement du mot de passe"""
|
||||||
user = super(PassForm, self).save(commit=False)
|
user = super(PassForm, self).save(commit=False)
|
||||||
user.set_password(self.cleaned_data.get("passwd1"))
|
user.set_password(self.cleaned_data.get("passwd1"))
|
||||||
|
user.state = User.STATE_NOT_YET_ACTIVE
|
||||||
user.set_active()
|
user.set_active()
|
||||||
user.save()
|
user.save()
|
||||||
|
|
||||||
|
|
|
@ -979,7 +979,7 @@ def reset_password(request):
|
||||||
user = User.objects.get(
|
user = User.objects.get(
|
||||||
pseudo=userform.cleaned_data["pseudo"],
|
pseudo=userform.cleaned_data["pseudo"],
|
||||||
email=userform.cleaned_data["email"],
|
email=userform.cleaned_data["email"],
|
||||||
state__in=[User.STATE_ACTIVE, User.STATE_NOT_YET_ACTIVE],
|
state__in=[User.STATE_ACTIVE, User.STATE_NOT_YET_ACTIVE, User.STATE_EMAIL_NOT_YET_CONFIRMED],
|
||||||
)
|
)
|
||||||
except User.DoesNotExist:
|
except User.DoesNotExist:
|
||||||
messages.error(request, _("The user doesn't exist."))
|
messages.error(request, _("The user doesn't exist."))
|
||||||
|
|
Loading…
Reference in a new issue