This commit is contained in:
parent
1de1cb4086
commit
ab1b68c456
7 changed files with 32 additions and 6 deletions
|
|
@ -2,6 +2,7 @@
|
|||
# Copyright (C) 2022 Amicale des élèves de l'ENS Paris-Saclay
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from allauth.account.models import EmailAddress
|
||||
from allauth.socialaccount.signals import pre_social_login
|
||||
from django.dispatch import receiver
|
||||
|
||||
|
|
@ -19,6 +20,7 @@ def sync_user_fields(sender, request, sociallogin, **kwargs):
|
|||
if email and user.email != email:
|
||||
user.email = email
|
||||
changed = True
|
||||
EmailAddress.objects.filter(user=user).update(email=email)
|
||||
|
||||
username = data.get("username")
|
||||
if username and user.username != username:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue