mirror of
https://github.com/jazzband/django-ddp.git
synced 2026-05-11 17:13:14 +00:00
Fix bug in Accounts.forgotPassword implementation.
This commit is contained in:
parent
047e5f01d1
commit
b059dcbeb0
1 changed files with 2 additions and 2 deletions
|
|
@ -284,7 +284,7 @@ class Auth(APIMixin):
|
|||
if key == 'username' or (key == self.user_model.USERNAME_FIELD):
|
||||
# username provided directly
|
||||
return val
|
||||
elif key == 'emails.address':
|
||||
elif key in ('email', 'emails.address'):
|
||||
email_field = getattr(self.user_model, 'EMAIL_FIELD', 'email')
|
||||
if self.user_model.USERNAME_FIELD == email_field:
|
||||
return val # email is username
|
||||
|
|
@ -449,7 +449,7 @@ class Auth(APIMixin):
|
|||
@api_endpoint('forgotPassword')
|
||||
def forgot_password(self, params):
|
||||
"""Request password reset email."""
|
||||
username = self.get_username(params['user'])
|
||||
username = self.get_username(params)
|
||||
try:
|
||||
user = self.user_model.objects.get(**{
|
||||
self.user_model.USERNAME_FIELD: username,
|
||||
|
|
|
|||
Loading…
Reference in a new issue