IntegrityError raised if user tries to set his email address to an address that another user is using

Bug #539265 reported by Chris Wagner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Resonate
Confirmed
Low
Unassigned

Bug Description

This can occur if user makes a POST request to /profile, specifying an already-in-use email address. This bug is unlikely to occur unless a user happens to have two accounts, and he tries to set the address for the one to be the same as that for the other. (That is how I came across this.)

This implies that the same exception will likely be raised if a user tries to signup using an already-in-use email address.

Here's a snippet of the traceback...
Traceback (most recent call last):

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/actions/__init__.py", line 20, in execute_view
    ret = view_func(request, *args, **kwargs)

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/actions/auth.py", line 173, in profile
    user.flush()

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/models.py", line 306, in flush
    return Model.flush(self)

  File "/home/chrisw/webapps/easyweaze/resonate/resonate/models.py", line 155, in flush
    dbsession.begin()

  ...

  File "/home/chrisw/lib/python2.5/sqlalchemy/engine/base.py", line 1123, in _cursor_execute
    self.dialect.do_execute(cursor, statement, parameters, context=context)

  File "/home/chrisw/lib/python2.5/sqlalchemy/engine/default.py", line 177, in do_execute
    cursor.execute(statement, parameters)

IntegrityError: (IntegrityError) duplicate key value violates unique constraint "users_email_key"
 'UPDATE users SET email=%(email)s WHERE users.id = %(users_id)s' {'users_id': 208, 'email': '<email address hidden>'}

Changed in resonate:
status: New → Confirmed
importance: Undecided → Low
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.