ingenieroariel / yolanda

GeoNode
1 stars 1 forks source link

Reset Password: appears to fail in email lookup #40

Closed opendri closed 10 years ago

opendri commented 10 years ago

I tried to reset my password on the new yolandadata.org side. Entered all my email addresses. System returns an "Email address can not be found." Same thing happened to Robert B from ARC today. May be a bug.

garnertb commented 10 years ago

I just tried getting my user name from the forgot user name page (http://yolandadata.org/people/forgotname) and got an error (500).

garnertb commented 10 years ago

I've fixed this for now. For the developers-> The error is coming from: https://github.com/pinax/django-user-accounts/blob/master/account/forms.py#L171.

My guess is that if we create accounts through the admin interface django-accounts isn't creating an EmailAddress object for them. I used the shell to resolve this:

from account.models import EmailAddress
from django.contrib.auth.models import User

for user in User.objects.all().exclude(email=""):
    EmailAddress.objects.create(user=user, email=user.email)
jj0hns0n commented 10 years ago

We should add some kind of signal to do this same thing when accounts are added via the admin. I've seen this before. Its also a bit strange that the email is stored in 2 different places but only used in one of them. Makes sense to have signals to make sure they are always in sync.

garnertb commented 10 years ago

I was also thinking of submitting a PR to django-accounts to check for the email in the EmailAddress table and on the user object that seems like an OK approach to me.