geonition/django_auth — Issue #14: Requesting a new password does not work if one password has two users
Author: ksnabb
Created: 2011-12-14 07:31:47+00:00
State: open

The password is not unique which makes a new password request with the email throw an error if there is two users returned with one password,, hope this makes:

Traceback (most recent call last):

File "/usr/lib/python2.4/site-packages/Django-1.3.1-py2.4.egg/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)

File "/l/pehmogis/e-pehmo/0.5/pehmogis/api/softgis_user/views.py", line 328, in new_password
current_user = User.objects.get(email=email)

File "/usr/lib/python2.4/site-packages/Django-1.3.1-py2.4.egg/django/db/models/manager.py", line 132, in get
return self.get_query_set().get(*args, **kwargs)

File "/usr/lib/python2.4/site-packages/Django-1.3.1-py2.4.egg/django/db/models/query.py", line 350, in get
raise self.model.MultipleObjectsReturned("get() returned more than one %s -- it returned %s! Lookup parameters were %s"

MultipleObjectsReturned: get() returned more than one User -- it returned 2! Lookup parameters were {'email': ''}