Update src/registrar/management/commands/create_federal_portfolio.py

This commit is contained in:
zandercymatics 2024-09-11 09:13:00 -06:00 committed by GitHub
parent 27f2157765
commit 97c7826455
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -195,7 +195,7 @@ class Command(BaseCommand):
DomainRequest.DomainRequestStatus.REJECTED,
]
domain_requests = DomainRequest.objects.filter(federal_agency=federal_agency).exclude(status__in=invalid_states)
if domain_requests.exists():
if not domain_requests.exists():
message = f"""
Portfolios not added to domain requests: no valid records found.
This means that a filter on DomainInformation for the federal_agency '{federal_agency}' returned no results.