Unit tests

This commit is contained in:
zandercymatics 2024-04-23 13:46:20 -06:00
parent 9ce10c370e
commit 54b615d7f8
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 134 additions and 1 deletions

View file

@ -3,6 +3,7 @@ import logging
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.db.models import Q
from registrar.models.user_domain_role import UserDomainRole
@ -177,7 +178,7 @@ class User(AbstractUser):
"""Retrieves the verification type based off of a provided email address"""
verification_type = None
if TransitionDomain.objects.filter(username=email).exists():
if TransitionDomain.objects.filter(Q(username=email) | Q(email=email)).exists():
# A new incoming user who is a domain manager for one of the domains
# that we inputted from Verisign (that is, their email address appears
# in the username field of a TransitionDomain)