fix oauth
All checks were successful
Docker / build (release) Successful in 9s

This commit is contained in:
krek0 2026-05-16 19:39:40 +02:00
parent 1de1cb4086
commit 52008749fc
8 changed files with 31 additions and 7 deletions

View file

@ -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: