Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
500 eror on web operations when duplicate email addresses exist #352
Description of problem
When two users are created with the same email address, various queries will fail due to multiple objects being found with the same email address. This might commonly happen by reusing the admin email address when creating a user through the admin panel. This results in a failure on any web action that results in sending an email alert to a user. The common one where I first noticed it is creating a new test run.
Component (web, API, etc)
Version or commit hash (if applicable)
How often reproducible
Steps to Reproduce
with debug enabled we get MultipleObjectsReturned get() returned more than one User -- it returned 2!
Operation successful, in the case of a test run ,we expect the run to be created after save and the notification email sent.
Workaround is to make sure the admin does not manually create any users with duplicate email addresses. Users created by the registration option are forced to have a unique email address. It might be a good idea to have the same check within the Admin interface for adding users.
There are now two users with the same email address in the database.