🐛(backend) filter invitation with case insensitive email
A user can be invited and no control is made on the email case. Then, when a new user is created, we are looking if there are pending invitation and the lookup used is case sensitive. We change it using __iexact which is case insensitive.
This commit is contained in:
@@ -221,7 +221,7 @@ class User(AbstractBaseUser, BaseModel, auth_models.PermissionsMixin):
|
||||
Expired invitations are ignored.
|
||||
"""
|
||||
valid_invitations = Invitation.objects.filter(
|
||||
email=self.email,
|
||||
email__iexact=self.email,
|
||||
created_at__gte=(
|
||||
timezone.now()
|
||||
- timedelta(seconds=settings.INVITATION_VALIDITY_DURATION)
|
||||
|
||||
Reference in New Issue
Block a user