kopia lustrzana https://github.com/wagtail/wagtail
Changes for password reset form
Fixed the styling of the "Enter your email..." message. When email was empty a 500 error was thrown - added check and exception for that case.pull/9/head
rodzic
00e7319929
commit
acb7a7f06e
|
@ -46,7 +46,9 @@ class PasswordResetForm(PasswordResetForm):
|
|||
|
||||
# Find users of this email address
|
||||
UserModel = get_user_model()
|
||||
email = cleaned_data['email']
|
||||
email = cleaned_data.get('email')
|
||||
if not email:
|
||||
raise forms.ValidationError("Please fill your email address.")
|
||||
active_users = UserModel._default_manager.filter(email__iexact=email, is_active=True)
|
||||
|
||||
if active_users.exists():
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
{% csrf_token %}
|
||||
<h1>Reset your password</h1>
|
||||
|
||||
<p>Enter your email address in the box below</p>
|
||||
|
||||
{% if form.non_field_errors %}
|
||||
<div class="messages">
|
||||
<ul>
|
||||
|
@ -28,6 +26,7 @@
|
|||
{% endif %}
|
||||
|
||||
<ul class="fields">
|
||||
<li>Enter your email address in the box below</li>
|
||||
<li>
|
||||
<div class="field">
|
||||
{{ form.email.label_tag }}
|
||||
|
|
Ładowanie…
Reference in New Issue