Skip to content

Commit

Permalink
social login bug fix that will check existed email before create User…
Browse files Browse the repository at this point in the history
…RegistHistory row.
  • Loading branch information
bluebamus committed Feb 6, 2024
1 parent cf36397 commit d567f3b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ def populate_user(self, request, sociallogin, data):
user = super().populate_user(request, sociallogin, data)
# user.username = user.email[:30]

if UserRegistHistory.objects.filter(email=user.email).exists():
return

if user.email is not None:
name = user.email.split("@")[0]
user.username = name
Expand Down

0 comments on commit d567f3b

Please sign in to comment.