lowercase emails on add user to domain; case insensitive match on matching DomainInvitations on login; test cases

This commit is contained in:
David Kennedy 2023-12-14 07:44:31 -05:00
parent d9237c2927
commit e36351d21e
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
4 changed files with 52 additions and 1 deletions

View file

@ -101,7 +101,7 @@ class User(AbstractUser):
"""When a user first arrives on the site, we need to retrieve any domain
invitations that match their email address."""
for invitation in DomainInvitation.objects.filter(
email=self.email, status=DomainInvitation.DomainInvitationStatus.INVITED
email__iexact=self.email, status=DomainInvitation.DomainInvitationStatus.INVITED
):
try:
invitation.retrieve()