diff --git a/apiserver/apiserver/api/serializers.py b/apiserver/apiserver/api/serializers.py index 35e748d..d8df89b 100644 --- a/apiserver/apiserver/api/serializers.py +++ b/apiserver/apiserver/api/serializers.py @@ -433,7 +433,7 @@ class MyPasswordChangeSerializer(PasswordChangeSerializer): class MyPasswordResetSerializer(PasswordResetSerializer): def validate_email(self, email): - if not User.objects.filter(email=email).exists(): + if not User.objects.filter(email__iexact=email).exists(): raise ValidationError('Not found.') return super().validate_email(email) diff --git a/apiserver/apiserver/api/utils.py b/apiserver/apiserver/api/utils.py index 1e36fd8..6ceebd1 100644 --- a/apiserver/apiserver/api/utils.py +++ b/apiserver/apiserver/api/utils.py @@ -231,7 +231,7 @@ def link_old_member(data, user): raise ValidationError(dict(email=msg)) try: - member = models.Member.objects.get(old_email=data['email']) + member = models.Member.objects.get(old_email__iexact=data['email']) except models.Member.DoesNotExist: msg = 'Unable to find email in old portal.' logger.info(msg) @@ -277,7 +277,7 @@ def link_old_member(data, user): def create_new_member(data, user): if old_models: old_members = old_models.Members.objects.using('old_portal') - if old_members.filter(email=data['email']).exists(): + if old_members.filter(email__iexact=data['email']).exists(): msg = 'Account was found in old portal.' logger.info(msg) raise ValidationError(dict(email=msg))