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
Current version doesn't seem to be associating different profiles by a common (if present) email address. In fact, the model UserEmail (which I believe is the responsible of this association) seems to never be created at all.
I would expect the UserEmail to be created in the following method of the User model:
@classmethod
def _get_or_create(cls, auth_id, emails, **kwarg):
assert isinstance(emails, list), 'Emails must be a list'
user = cls._find_user(auth_id, emails)
# if user and emails is not None:
# user._add_emails(emails)
if user is None:
user = cls._create_user(auth_id, **kwarg)
return user
But that part of the code is commented out, and I can't find the reason in the logs. Is it safe to remove the comments?, is the User<-Email->UserProfile association done here, or am I completely clueless?.
Thank you so much!
The text was updated successfully, but these errors were encountered:
You are correct the UserEmail is not being created. I removed the logic, because I wasn't satisfied with the implementation, and I still had some issue that I needed to address. Uncommenting the lines you mentioned will not add Email Address uniqueness validation -- more work needs to be done. Unfortunately I don't have the time to make these changes now, but I will keep this issue open until I do.
If you are interested in adding this functionality yourself. All you need to do is create a UserEmail when creating a User. Then when creating subsequent users do a get_by_id prior to creation. Alternatively, you could add a emails property to the User model, if your comfortable with eventual consistency, i.e. User searches by email maybe delayed, therefore reporting that a user associated with an email address doesn't exist when one actually does.
Current version doesn't seem to be associating different profiles by a common (if present) email address. In fact, the model UserEmail (which I believe is the responsible of this association) seems to never be created at all.
I would expect the UserEmail to be created in the following method of the User model:
But that part of the code is commented out, and I can't find the reason in the logs. Is it safe to remove the comments?, is the User<-Email->UserProfile association done here, or am I completely clueless?.
Thank you so much!
The text was updated successfully, but these errors were encountered: