mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-12 22:18:25 +02:00
Update portfolio.py
This commit is contained in:
parent
5afad6b91d
commit
273cf91f76
1 changed files with 9 additions and 9 deletions
|
@ -124,6 +124,15 @@ class Portfolio(TimeStampedModel):
|
|||
def __str__(self) -> str:
|
||||
return str(self.organization_name)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
"""Save override for custom properties"""
|
||||
|
||||
# The urbanization field is only intended for the state_territory puerto rico
|
||||
if self.state_territory != self.StateTerritoryChoices.PUERTO_RICO and self.urbanization:
|
||||
self.urbanization = None
|
||||
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
@property
|
||||
def portfolio_type(self):
|
||||
"""
|
||||
|
@ -148,12 +157,3 @@ class Portfolio(TimeStampedModel):
|
|||
def get_suborganizations(self):
|
||||
"""Returns all suborganizations associated with this portfolio"""
|
||||
return self.portfolio_suborganizations.all()
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
"""Save override for custom properties"""
|
||||
|
||||
# The urbanization field is only intended for the state_territory puerto rico
|
||||
if self.state_territory != self.StateTerritoryChoices.PUERTO_RICO and self.urbanization:
|
||||
self.urbanization = None
|
||||
|
||||
super().save(*args, **kwargs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue