fix bug I introduced with automatic EmailAddress creation for LDAP users (#10347)

This commit is contained in:
Jacob Felknor
2025-09-19 07:23:44 +10:00
committed by GitHub
parent d1a05f84bc
commit fd57b5354b
+4 -1
View File
@@ -63,7 +63,10 @@ if settings.LDAP_AUTH:
user.save()
# if they got an email address from LDAP, create it now and make it the primary
if user.email:
if (
user.email
and not EmailAddress.objects.filter(user=user, email=user.email).exists()
):
EmailAddress.objects.create(user=user, email=user.email, primary=True)