mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-26 11:03:49 +02:00
update to portfolio model and associated tests
This commit is contained in:
parent
5c061fec30
commit
d64a48934c
2 changed files with 42 additions and 0 deletions
|
@ -122,6 +122,16 @@ class Portfolio(TimeStampedModel):
|
|||
if self.state_territory != self.StateTerritoryChoices.PUERTO_RICO and self.urbanization:
|
||||
self.urbanization = None
|
||||
|
||||
# If the org type is federal, and org federal agency is not blank, and is a federal agency
|
||||
# overwrite the organization name with the federal agency's agency
|
||||
if (
|
||||
self.organization_type == self.OrganizationChoices.FEDERAL
|
||||
and self.federal_agency
|
||||
and self.federal_agency != FederalAgency.get_non_federal_agency()
|
||||
and self.federal_agency.agency
|
||||
):
|
||||
self.organization_name = self.federal_agency.agency
|
||||
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
@property
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue