[root at localhost: [Django] Error (EXTERNAL IP): /register/]

Ralf Baechle ralf at linux-mips.org
Thu Dec 8 03:02:31 EST 2011


Below trace is the result of trying to re-register my already registered
email address with a new account for test purposes.

Not sure what should be sensible behaviour.  A user might have forgotten
about the existence of his patchwork account and try to re-register; in
this case an error message might be prefered.  Or might have inherited
an email address that previously registered to somebody else or possibly
want it to be registered to multiple accounts for other legitimate
reasons such shared email accounts.

Error messages below.

  Ralf

----- Forwarded message from root at localhost -----

Date: Wed, 07 Dec 2011 12:02:38 -0000
From: root at localhost
To: ralf at linux-mips.org
Subject: [Django] Error (EXTERNAL IP): /register/
Content-Type: text/plain; charset="utf-8"

Traceback (most recent call last):

  File "/var/www/patchwork.linux-mips.org/patchwork/lib/python/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/var/www/patchwork.linux-mips.org/patchwork/apps/patchwork/views/user.py", line 42, in register
    if form.is_valid():

  File "/var/www/patchwork.linux-mips.org/patchwork/lib/python/django/forms/forms.py", line 121, in is_valid
    return self.is_bound and not bool(self.errors)

  File "/var/www/patchwork.linux-mips.org/patchwork/lib/python/django/forms/forms.py", line 112, in _get_errors
    self.full_clean()

  File "/var/www/patchwork.linux-mips.org/patchwork/lib/python/django/forms/forms.py", line 267, in full_clean
    self._clean_fields()

  File "/var/www/patchwork.linux-mips.org/patchwork/lib/python/django/forms/forms.py", line 287, in _clean_fields
    value = getattr(self, 'clean_%s' % name)()

  File "/var/www/patchwork.linux-mips.org/patchwork/apps/patchwork/forms.py", line 47, in clean_email
    user = User.objects.get(email__iexact = value)

  File "/var/www/patchwork.linux-mips.org/patchwork/lib/python/django/db/models/manager.py", line 132, in get
    return self.get_query_set().get(*args, **kwargs)

  File "/var/www/patchwork.linux-mips.org/patchwork/lib/python/django/db/models/query.py", line 349, in get
    % (self.model._meta.object_name, num, kwargs))

MultipleObjectsReturned: get() returned more than one User -- it returned 2! Lookup parameters were {'email__iexact': u'ralf at linux-mips.org'}


<ModPythonRequest
path:/register/,
GET:<QueryDict: {}>,
POST:<QueryDict: {u'username': [u'asdf'], u'first_name': [u'Toasty'], u'last_name': [u'Tester'], u'csrfmiddlewaretoken': [u'ae525506ac7a24f576da3a803ec167d1'], u'password': [u'asdfasdf'], u'email': [u'ralf at linux-mips.org']}>,
COOKIES:{'csrftoken': 'ae525506ac7a24f576da3a803ec167d1',
 'sessionid': '81784dbf3fc42d69e1b47ff2c1207474'},
META:{'AUTH_TYPE': None,
 'CONTENT_LENGTH': '147',
 'CONTENT_TYPE': 'application/x-www-form-urlencoded',
 'CSRF_COOKIE': 'ae525506ac7a24f576da3a803ec167d1',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
 'HTTP_ACCEPT_ENCODING': 'gzip,deflate',
 'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_CONTENT_LENGTH': '147',
 'HTTP_CONTENT_TYPE': 'application/x-www-form-urlencoded',
 'HTTP_COOKIE': 'csrftoken=ae525506ac7a24f576da3a803ec167d1; sessionid=81784dbf3fc42d69e1b47ff2c1207474',
 'HTTP_HOST': 'patchwork.linux-mips.org',
 'HTTP_KEEP_ALIVE': '115',
 'HTTP_REFERER': 'https://patchwork.linux-mips.org/register/',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.6.24-1.fc14 Firefox/3.6.24',
 'PATH_INFO': u'/register/',
 'PATH_TRANSLATED': None,
 'QUERY_STRING': None,
 'REMOTE_ADDR': '81.2.74.5',
 'REMOTE_HOST': None,
 'REMOTE_IDENT': None,
 'REMOTE_USER': None,
 'REQUEST_METHOD': 'POST',
 'SCRIPT_NAME': '',
 'SERVER_NAME': 'patchwork.linux-mips.org',
 'SERVER_PORT': 443,
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'mod_python'}>

----- End forwarded message -----


More information about the Patchwork mailing list