fix script

This commit is contained in:
zandercymatics 2024-04-08 14:59:07 -06:00
parent 212d2002e3
commit a976171179
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
4 changed files with 25 additions and 14 deletions

View file

@ -666,9 +666,11 @@ class DomainRequest(TimeStampedModel):
help_text="Notes about this request",
)
def save(self, *args, **kwargs):
"""Save override for custom properties"""
def sync_organization_type(self):
"""
Updates the organization_type (without saving) to match
the is_election_board and generic_organization_type fields.
"""
# Define mappings between generic org and election org.
# These have to be defined here, as you'd get a cyclical import error
# otherwise.
@ -692,6 +694,10 @@ class DomainRequest(TimeStampedModel):
# Actually updates the organization_type field
org_type_helper.create_or_update_organization_type()
def save(self, *args, **kwargs):
"""Save override for custom properties"""
self.sync_organization_type()
super().save(*args, **kwargs)
def __str__(self):