You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 18, 2024. It is now read-only.
try:
addr=EmailAddress.objects.get(user=user,email=user.email)
# Provides that an address that has been just verified# without use of django-multimail, is still considered# verified in conditions of django-multimailifuser.is_activeandnotaddr.verified_at:
addr.verified_at=now()
exceptEmailAddress.DoesNotExist:
addr=EmailAddress()
addr.user=useraddr.email=user.emailaddr.save(verify=False)
The search you do is for user X and e-mail Y. If there's user Z with e-mail Y, you find 0 results, then you try to add (X,Y) which fails due to uniqueness (Y already exists).
I think: before creating a new one (X,Y), you should .filter(email=user.email) to see whether that e-mail (*,Y) already exists.
Just before the code I posted there's another piece of code that needs the same change.