mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	fix bug I introduced with automatic EmailAddress creation for LDAP users (#10347)
This commit is contained in:
		@@ -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)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user