Update create_federal_portfolio.py

This commit is contained in:
zandercymatics 2024-11-27 14:33:13 -07:00
parent 0c3fb834ff
commit 8304caf026
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -87,7 +87,7 @@ class Command(BaseCommand):
except Exception as exec:
self.failed_portfolios.add(federal_agency)
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.log_script_run_summary(
@ -174,6 +174,10 @@ class Command(BaseCommand):
# Check for existing suborgs on the current portfolio
existing_suborgs = Suborganization.objects.filter(name__in=org_names)
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}'."
TerminalHelper.colorful_logger(logger.info, TerminalColors.OKBLUE, message)