mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-13 13:09:41 +02:00
Update create_federal_portfolio.py
This commit is contained in:
parent
91e62a6cdf
commit
f2288673a0
1 changed files with 8 additions and 1 deletions
|
@ -193,7 +193,14 @@ class Command(BaseCommand):
|
||||||
Associate portfolio with domain requests for a federal agency.
|
Associate portfolio with domain requests for a federal agency.
|
||||||
Updates all relevant domain request records.
|
Updates all relevant domain request records.
|
||||||
"""
|
"""
|
||||||
domain_requests = DomainInformation.objects.filter(federal_agency=federal_agency)
|
invalid_states = [
|
||||||
|
DomainRequest.DomainRequestStatus.STARTED,
|
||||||
|
DomainRequest.DomainRequestStatus.INELIGIBLE,
|
||||||
|
DomainRequest.DomainRequestStatus.REJECTED,
|
||||||
|
]
|
||||||
|
domain_requests = DomainRequest.objects.filter(
|
||||||
|
federal_agency=federal_agency
|
||||||
|
).exclude(status__in=invalid_states)
|
||||||
if not domain_requests.exists():
|
if not domain_requests.exists():
|
||||||
message = "Portfolios not added to domain requests: no valid records found"
|
message = "Portfolios not added to domain requests: no valid records found"
|
||||||
TerminalHelper.colorful_logger(logger.info, TerminalColors.YELLOW, message)
|
TerminalHelper.colorful_logger(logger.info, TerminalColors.YELLOW, message)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue