Merge branch 'main' of github.com:cisagov/manage.get.gov into es/2398-sandbox-deploy-workflow

This commit is contained in:
Erin 2024-07-11 15:48:26 -07:00
commit 9f22184857
No known key found for this signature in database
GPG key ID: 1CAD275313C62460

View file

@ -136,6 +136,13 @@ class DomainRequest(TimeStampedModel):
@classmethod
def get_org_label(cls, org_name: str):
"""Returns the associated label for a given org name"""
# This is an edgecase on domains with no org.
# This unlikely to happen but
# a break will occur in certain edge cases without this.
# (more specifically, csv exports).
if not org_name:
return None
org_names = org_name.split("_election")
if len(org_names) > 0:
org_name = org_names[0]