On May 18, 2021, at 5:34 PM, Mark Sapiro <mark@msapiro.net> wrote:
On 5/18/21 4:06 PM, Mark Dadgar wrote:
I have a user attempting to access the list archives and he’s generating this login error. I have verified that he does have a django account. I’ve never seen this one before and I didn’t find anything relevant in the lit archives.
Any ideas what’s going on here? ... File "/opt/mailman/mm/venv/lib/python3.8/site-packages/allauth/account/utils.py", line 134, in _has_verified_for_login emailaddress = EmailAddress.objects.get_for_user(user, email) File "/opt/mailman/mm/venv/lib/python3.8/site-packages/allauth/account/managers.py", line 54, in get_for_user ret = self.get(user=user, email__iexact=email) File "/opt/mailman/mm/venv/lib/python3.8/site-packages/django/db/models/manager.py", line 82, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/opt/mailman/mm/venv/lib/python3.8/site-packages/django/db/models/query.py", line 419, in get raise self.model.MultipleObjectsReturned(
Exception Type: MultipleObjectsReturned at /accounts/login/ Exception Value: get() returned more than one EmailAddress -- it returned 2! Request information: USER: AnonymousUser
Go to the Django admin users page - something like http(s)://example.com/admin/auth/user/ - and search for the email address. This search is case-insensitive and I'm guessing it will find two users differing in case.
In any event, django allauth is trying to find this user and is finding multiple EmailAddress.objects for this address or username.
I had actually done this but checked the Users section and had overlooked the Email Addresses section. It was as you suggested - duplicate emails differing only in case.
Given that there was only one user account, how does this happen? List subscription without associated user account creation with slightly different case?
- Mark
mark@pdc-racing.net | 408-348-2878