Add PR suggestions

This commit is contained in:
zandercymatics 2024-08-12 08:44:25 -06:00
parent 47779f8f29
commit 44b8163422
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
3 changed files with 19 additions and 3 deletions

View file

@ -110,3 +110,12 @@ class Portfolio(TimeStampedModel):
def __str__(self) -> str:
return f"{self.organization_name}"
def save(self, *args, **kwargs):
"""Save override for custom properties"""
# We can't have urbanization if the state isn't puerto rico
if self.state_territory != self.StateTerritoryChoices.PUERTO_RICO and self.urbanization:
self.urbanization = None
super().save(*args, **kwargs)