Skip to content

Commit

Permalink
v0.6.6: Forgot password form now honors USER_SHOW_USERNAME_OR_EMAIL_N…
Browse files Browse the repository at this point in the history
…OT_FOUND setting.
  • Loading branch information
lingthio committed Aug 5, 2015
1 parent 076b50f commit 49b5643
Show file tree
Hide file tree
Showing 18 changed files with 388 additions and 379 deletions.
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Documentation

Revision History
----------------
* v0.6.6 Forgot password form now honors USER_SHOW_USERNAME_OR_EMAIL_DOES_NOT_EXIST setting.
* v0.6.5 Added USER_SHOW_USERNAME_OR_EMAIL_DOES_NOT_EXIST setting.
* v0.6.4 Moved custom params from __init__() to init_app(). Added send_reset_password_email().
* v0.6.3 Fix for Python 3.4 and signals. Added UserMixin.has_role() and @roles_accepted().
Expand Down
2 changes: 1 addition & 1 deletion flask_user/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# Enable the following: from flask.ext.user import user_logged_in
from .signals import *

__version__ = '0.6.5'
__version__ = '0.6.6'

def _flask_user_context_processor():
""" Make 'user_manager' available to Jinja2 templates"""
Expand Down
8 changes: 8 additions & 0 deletions flask_user/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ class ForgotPasswordForm(Form):
])
submit = SubmitField(_('Send reset password email'))

def validate_email(form, field):
user_manager = current_app.user_manager
if user_manager.show_username_email_does_not_exist:
user, user_email = user_manager.find_user_by_email(field.data)
if not user:
raise ValidationError(_('%(username_or_email)s does not exist', username_or_email=_('Email')))


class LoginForm(Form):
next = HiddenField() # for login.html
reg_next = HiddenField() # for login_or_register.html
Expand Down
Binary file modified flask_user/translations/en/LC_MESSAGES/flask_user.mo
Binary file not shown.
101 changes: 52 additions & 49 deletions flask_user/translations/en/LC_MESSAGES/flask_user.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-08-03 13:40-0700\n"
"POT-Creation-Date: 2015-08-05 12:15-0700\n"
"PO-Revision-Date: 2015-08-03 13:37-0800\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: en <LL@li.org>\n"
Expand Down Expand Up @@ -39,18 +39,18 @@ msgstr ""
msgid "This Email is already in use. Please try another one."
msgstr ""

#: flask_user/forms.py:66 flask_user/forms.py:159 flask_user/forms.py:218
#: flask_user/forms.py:246 flask_user/forms.py:322
#: flask_user/forms.py:66 flask_user/forms.py:167 flask_user/forms.py:226
#: flask_user/forms.py:254 flask_user/forms.py:330
msgid "Email"
msgstr ""

#: flask_user/forms.py:67 flask_user/forms.py:160 flask_user/forms.py:247
#: flask_user/forms.py:323
#: flask_user/forms.py:67 flask_user/forms.py:168 flask_user/forms.py:255
#: flask_user/forms.py:331
msgid "Email is required"
msgstr ""

#: flask_user/forms.py:68 flask_user/forms.py:161 flask_user/forms.py:248
#: flask_user/forms.py:324
#: flask_user/forms.py:68 flask_user/forms.py:169 flask_user/forms.py:256
#: flask_user/forms.py:332
msgid "Invalid Email"
msgstr ""

Expand All @@ -66,23 +66,23 @@ msgstr ""
msgid "Old Password is required"
msgstr ""

#: flask_user/forms.py:76 flask_user/forms.py:296
#: flask_user/forms.py:76 flask_user/forms.py:304
msgid "New Password"
msgstr ""

#: flask_user/forms.py:77 flask_user/forms.py:297
#: flask_user/forms.py:77 flask_user/forms.py:305
msgid "New Password is required"
msgstr ""

#: flask_user/forms.py:79 flask_user/forms.py:298
#: flask_user/forms.py:79 flask_user/forms.py:306
msgid "Retype New Password"
msgstr ""

#: flask_user/forms.py:80 flask_user/forms.py:299
#: flask_user/forms.py:80 flask_user/forms.py:307
msgid "New Password and Retype Password did not match"
msgstr ""

#: flask_user/forms.py:83 flask_user/forms.py:301
#: flask_user/forms.py:83 flask_user/forms.py:309
#: flask_user/templates/flask_user/change_password.html:5
#: flask_user/templates/flask_user/user_profile.html:11
msgid "Change password"
Expand All @@ -96,7 +96,7 @@ msgstr ""
msgid "New Username"
msgstr ""

#: flask_user/forms.py:113 flask_user/forms.py:157 flask_user/forms.py:244
#: flask_user/forms.py:113 flask_user/forms.py:165 flask_user/forms.py:252
msgid "Username is required"
msgstr ""

Expand All @@ -106,84 +106,84 @@ msgstr ""
msgid "Change username"
msgstr ""

#: flask_user/forms.py:146 flask_user/forms.py:289
#: flask_user/forms.py:146 flask_user/forms.py:297
msgid "Your email address"
msgstr ""

#: flask_user/forms.py:147 flask_user/forms.py:290
#: flask_user/forms.py:147 flask_user/forms.py:298
msgid "Email address is required"
msgstr ""

#: flask_user/forms.py:148 flask_user/forms.py:291
#: flask_user/forms.py:148 flask_user/forms.py:299
msgid "Invalid Email address"
msgstr ""

#: flask_user/forms.py:150
msgid "Send reset password email"
msgstr ""

#: flask_user/forms.py:156 flask_user/forms.py:215 flask_user/forms.py:243
#: flask_user/forms.py:157 flask_user/forms.py:231
#, python-format
msgid "%(username_or_email)s does not exist"
msgstr ""

#: flask_user/forms.py:164 flask_user/forms.py:223 flask_user/forms.py:251
msgid "Username"
msgstr ""

#: flask_user/forms.py:163 flask_user/forms.py:250
#: flask_user/forms.py:171 flask_user/forms.py:258
msgid "Password"
msgstr ""

#: flask_user/forms.py:164 flask_user/forms.py:251
#: flask_user/forms.py:172 flask_user/forms.py:259
msgid "Password is required"
msgstr ""

#: flask_user/forms.py:166
#: flask_user/forms.py:174
msgid "Remember me"
msgstr ""

#: flask_user/forms.py:168 flask_user/templates/flask_user/login.html:5
#: flask_user/forms.py:176 flask_user/templates/flask_user/login.html:5
#: flask_user/templates/flask_user/login_or_register.html:9
msgid "Sign in"
msgstr ""

#: flask_user/forms.py:175
#: flask_user/forms.py:183
msgid "Username or Email"
msgstr ""

#: flask_user/forms.py:212
#: flask_user/forms.py:220
msgid "Username/Email"
msgstr ""

#: flask_user/forms.py:223
#, python-format
msgid "%(username_or_email)s does not exist"
msgstr ""

#: flask_user/forms.py:230
#: flask_user/forms.py:238
#, python-format
msgid "Incorrect %(username_or_email)s and/or Password"
msgstr ""

#: flask_user/forms.py:252
#: flask_user/forms.py:260
msgid "Retype Password"
msgstr ""

#: flask_user/forms.py:253
#: flask_user/forms.py:261
msgid "Password and Retype Password did not match"
msgstr ""

#: flask_user/forms.py:254
#: flask_user/forms.py:262
msgid "Token"
msgstr ""

#: flask_user/forms.py:256
#: flask_user/forms.py:264
#: flask_user/templates/flask_user/login_or_register.html:41
#: flask_user/templates/flask_user/register.html:5
msgid "Register"
msgstr ""

#: flask_user/forms.py:293
#: flask_user/forms.py:301
msgid "Resend email confirmation email"
msgstr ""

#: flask_user/forms.py:326
#: flask_user/forms.py:334
msgid "Invite!"
msgstr ""

Expand Down Expand Up @@ -220,72 +220,72 @@ msgstr ""
msgid "Your username has been changed to '%(username)s'."
msgstr ""

#: flask_user/views.py:197
#: flask_user/views.py:200
#, python-format
msgid ""
"A reset password email has been sent to '%(email)s'. Open that email and "
"follow the instructions to reset your password."
msgstr ""

#: flask_user/views.py:268
#: flask_user/views.py:271
msgid "You have signed out successfully."
msgstr ""

#: flask_user/views.py:506
#: flask_user/views.py:509
msgid "Invitation has been sent."
msgstr ""

#: flask_user/views.py:549
#: flask_user/views.py:552
msgid "Your reset password token has expired."
msgstr ""

#: flask_user/views.py:553 flask_user/views.py:564
#: flask_user/views.py:556 flask_user/views.py:567
msgid "Your reset password token is invalid."
msgstr ""

#: flask_user/views.py:591
#: flask_user/views.py:594
msgid "Your password has been reset successfully."
msgstr ""

#: flask_user/views.py:608
#: flask_user/views.py:611
#, python-format
msgid "You must confirm your email to access '%(url)s'."
msgstr ""

#: flask_user/views.py:619
#: flask_user/views.py:622
#, python-format
msgid "You must be signed in to access '%(url)s'."
msgstr ""

#: flask_user/views.py:633
#: flask_user/views.py:636
#, python-format
msgid "You do not have permission to access '%(url)s'."
msgstr ""

#: flask_user/views.py:664 flask_user/views.py:685
#: flask_user/views.py:667 flask_user/views.py:688
#, python-format
msgid ""
"A confirmation email has been sent to %(email)s with instructions to "
"complete your registration."
msgstr ""

#: flask_user/views.py:666
#: flask_user/views.py:669
msgid "You have registered successfully."
msgstr ""

#: flask_user/views.py:694
#: flask_user/views.py:697
msgid "Your account has not been enabled."
msgstr ""

#: flask_user/views.py:703
#: flask_user/views.py:706
#, python-format
msgid ""
"Your email address has not yet been confirmed. Check your email Inbox and"
" Spam folders for the confirmation email or <a href=\"%(url)s\">Re-send "
"confirmation email</a>."
msgstr ""

#: flask_user/views.py:714
#: flask_user/views.py:717
msgid "You have signed in successfully."
msgstr ""

Expand Down Expand Up @@ -356,3 +356,6 @@ msgstr ""
#~ msgid "Change Username"
#~ msgstr ""

#~ msgid "Email does not exist"
#~ msgstr ""

Binary file modified flask_user/translations/fi/LC_MESSAGES/flask_user.mo
Binary file not shown.
Loading

0 comments on commit 49b5643

Please sign in to comment.