Confirming an email address throws an unexpected error when already confirmed via Persona
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Libravatar (obsolete) |
Fix Released
|
Medium
|
François Marier |
Bug Description
When a user clicks a confirmation link for an email that has already been confirmed using Persona, an error page is displayed due to a database uniqueness constraint violation:
File "/usr/share/
not request.
File "/usr/share/
confirmed.
IntegrityError: ERREUR: la valeur d'une clé dupliquée rompt la contrainte unique « account_
Steps to reproduce:
1- create a new username+password account
2- add a new email address manually (but don't check your emails yet)
3- add a new email address but this time, use Persona to add the same one
4- go back to the profile page to see that email address both under "confirmed" and "unconfirmed" emails
5- click on the link sent in the confirmation email
summary: |
- Confirming an email address fail when already confirmed via Persona + Confirming an email address throws an unexpected error when already + confirmed via Persona |
Changed in libravatar: | |
status: | Fix Committed → Fix Released |
Three things to fix:
1. the unconfirmed email should be deleted before we attempt to confirm the email to ensure that any bugs further down the function don't leave unconfirmed emails around
2. before creating a confirmed email object, check that it's not already confirmed. if it is, display an appropriate error message
3. confirming an email using Persona should delete any matching unconfirmed emails that a user has in their account