forked from CGM_Public/pretix_original
Fixed bugs in the password recovery
This commit is contained in:
@@ -213,7 +213,12 @@ class PasswordForgotForm(Form):
|
|||||||
email=username, event=self.event
|
email=username, event=self.event
|
||||||
)
|
)
|
||||||
return username
|
return username
|
||||||
except:
|
except User.MultipleObjectsReturned:
|
||||||
|
raise forms.ValidationError(
|
||||||
|
_("We found multiple users with that e-mail address. Please specify the username instead"),
|
||||||
|
code='unknown_user',
|
||||||
|
)
|
||||||
|
except User.DoesNotExist:
|
||||||
raise forms.ValidationError(
|
raise forms.ValidationError(
|
||||||
_("We are unable to find a user matching the data you provided."),
|
_("We are unable to find a user matching the data you provided."),
|
||||||
code='unknown_user',
|
code='unknown_user',
|
||||||
|
|||||||
@@ -271,6 +271,7 @@ class EventRecover(EventViewMixin, TemplateView):
|
|||||||
return self.invalid('invalid')
|
return self.invalid('invalid')
|
||||||
else:
|
else:
|
||||||
user.set_password(self.form.cleaned_data['password'])
|
user.set_password(self.form.cleaned_data['password'])
|
||||||
|
user.save()
|
||||||
messages.success(request, _('You can now login using your new password.'))
|
messages.success(request, _('You can now login using your new password.'))
|
||||||
return redirect('presale:event.checkout.login',
|
return redirect('presale:event.checkout.login',
|
||||||
organizer=self.request.event.organizer.slug,
|
organizer=self.request.event.organizer.slug,
|
||||||
|
|||||||
Reference in New Issue
Block a user