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
I'm not sure how this happens in production, but we have multiple user accounts with the same email address.
In these cases, the import_alums management command fails with this traceback:
Traceback (most recent call last):
File "/app/profiles/api.py", line 397, in import_alumni
import_alum(alum)
File "/app/profiles/api.py", line 299, in import_alum
user = User.objects.get(email__iexact=alum.learner_email)
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/models/query.py", line 412, in get
(self.model._meta.object_name, num)
django.contrib.auth.models.MultipleObjectsReturned: get() returned more than one User -- it returned 3!
When there is more than once account with the same email, we could chose the one that has been logged in to most recently.
The text was updated successfully, but these errors were encountered:
Looks like there are lots of users with dupe email accounts on prod (536 dupe emails), in the worst case 6 Users with the same email (but only 1 of those ever logged in).
This complicates hubspot api syncing, and specifically tracking the hubspot id associated with each contact.
Hubspot only allows 1 contact per email, so users with dupe emails would all be associated with the same hubspot id, but that will lead to an integrity error in our database (only 1 contact per hubspot id allowed).
Not sure if I should remove that integrity constraint or fix the underlying issue causing dupe emails and remove the users that never logged in. Of the 536 dupes, there are only 4 where >1 User logged in.
I'm not sure how this happens in production, but we have multiple user accounts with the same email address.
In these cases, the
import_alums
management command fails with this traceback:When there is more than once account with the same email, we could chose the one that has been logged in to most recently.
The text was updated successfully, but these errors were encountered: