Bug fix after merge and cleanup

This commit is contained in:
zandercymatics 2024-07-17 10:52:27 -06:00
parent 5532aa1516
commit cea47d1d3d
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
4 changed files with 28 additions and 18 deletions

View file

@ -161,13 +161,10 @@ class User(AbstractUser):
"""Return count of ineligible requests"""
return self.domain_requests_created.filter(status=DomainRequest.DomainRequestStatus.INELIGIBLE).count()
def get_formatted_name(self, return_unknown_when_none=True):
def get_formatted_name(self):
"""Returns the contact's name in Western order."""
names = [n for n in [self.first_name, self.middle_name, self.last_name] if n]
if names:
return " ".join(names)
else:
return "Unknown" if return_unknown_when_none else None
return " ".join(names) if names else "Unknown"
def has_contact_info(self):
return bool(self.title or self.email or self.phone)