User created from submission cannot login

Bug #891219 reported by Marc Tardif
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad Results
Fix Released
High
Marc Tardif

Bug Description

When a user was created from a submission, it is not possible to login because the OpenID integration attempts to create the user again. The solution is to check if the nickname exists already in addition to the identify url. Here's the traceback:

WARNING:root:Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py", line 92, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.6/dist-packages/lpresults/tracker/views/login.py", line 50, in login_complete
    user = authenticate(request=request)
  File "/usr/lib/pymodules/python2.6/django/contrib/auth/__init__.py", line 37, in authenticate
    user = backend.authenticate(**credentials)
  File "/usr/lib/python2.6/dist-packages/lpresults/session/auth.py", line 40, in authenticate
    response.fields["nickname"], response.identity_url)
  File "/usr/lib/python2.6/dist-packages/lpresults/registry/models/person.py", line 120, in create
    store.flush()
  File "/usr/lib/python2.6/dist-packages/storm/store.py", line 485, in flush
    self._flush_one(obj_info)
  File "/usr/lib/python2.6/dist-packages/storm/store.py", line 522, in _flush_one
    result = self._connection.execute(expr)
  File "/usr/lib/python2.6/dist-packages/storm/databases/postgres.py", line 243, in execute
    result = Connection.execute(self, Returning(statement), params)
  File "/usr/lib/python2.6/dist-packages/storm/database.py", line 238, in execute
    raw_cursor = self.raw_execute(statement, params)
  File "/usr/lib/python2.6/dist-packages/storm/databases/postgres.py", line 259, in raw_execute
    return Connection.raw_execute(self, statement, params)
  File "/usr/lib/python2.6/dist-packages/storm/database.py", line 322, in raw_execute
    self._check_disconnect(raw_cursor.execute, *args)
  File "/usr/lib/python2.6/dist-packages/storm/database.py", line 371, in _check_disconnect
    return function(*args, **kwargs)
IntegrityError: duplicate key value violates unique constraint "person__name__key"

Marc Tardif (cr3)
Changed in launchpad-results:
assignee: nobody → Marc Tardif (cr3)
status: New → Triaged
importance: Undecided → Critical
importance: Critical → High
Marc Tardif (cr3)
Changed in launchpad-results:
status: Triaged → Fix Committed
Marc Tardif (cr3)
Changed in launchpad-results:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.