mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-16 06:24:12 +02:00
Update create_federal_portfolio.py
This commit is contained in:
parent
0c3fb834ff
commit
8304caf026
1 changed files with 5 additions and 1 deletions
|
@ -87,7 +87,7 @@ class Command(BaseCommand):
|
||||||
except Exception as exec:
|
except Exception as exec:
|
||||||
self.failed_portfolios.add(federal_agency)
|
self.failed_portfolios.add(federal_agency)
|
||||||
logger.error(exec)
|
logger.error(exec)
|
||||||
message = f"Failed to create portfolio '{portfolio}'"
|
message = f"Failed to create portfolio '{federal_agency.agency}'"
|
||||||
TerminalHelper.colorful_logger(logger.info, TerminalColors.FAIL, message)
|
TerminalHelper.colorful_logger(logger.info, TerminalColors.FAIL, message)
|
||||||
|
|
||||||
TerminalHelper.log_script_run_summary(
|
TerminalHelper.log_script_run_summary(
|
||||||
|
@ -174,6 +174,10 @@ class Command(BaseCommand):
|
||||||
# Check for existing suborgs on the current portfolio
|
# Check for existing suborgs on the current portfolio
|
||||||
existing_suborgs = Suborganization.objects.filter(name__in=org_names)
|
existing_suborgs = Suborganization.objects.filter(name__in=org_names)
|
||||||
if existing_suborgs.exists():
|
if existing_suborgs.exists():
|
||||||
|
# QUESTION FOR REVIEWERS: Should we be doing this too?
|
||||||
|
# existing_suborgs.filter(portfolio__isnull=True).update(
|
||||||
|
# portfolio=portfolio
|
||||||
|
# )
|
||||||
message = f"Some suborganizations already exist for portfolio '{portfolio}'."
|
message = f"Some suborganizations already exist for portfolio '{portfolio}'."
|
||||||
TerminalHelper.colorful_logger(logger.info, TerminalColors.OKBLUE, message)
|
TerminalHelper.colorful_logger(logger.info, TerminalColors.OKBLUE, message)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue