mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-12 05:58:18 +02:00
formatted for linter
This commit is contained in:
parent
73b0b33ee8
commit
946baf05e9
3 changed files with 6 additions and 4 deletions
|
@ -33,7 +33,7 @@ class RegistrarForm(forms.Form):
|
|||
# save a reference to an application object
|
||||
self.application = kwargs.pop("application", None)
|
||||
super(RegistrarForm, self).__init__(*args, **kwargs)
|
||||
|
||||
|
||||
def to_database(self, obj: DomainApplication | Contact):
|
||||
"""
|
||||
Adds this form's cleaned data to `obj` and saves `obj`.
|
||||
|
@ -329,7 +329,7 @@ class AboutYourOrganizationForm(RegistrarForm):
|
|||
|
||||
class AuthorizingOfficialForm(RegistrarForm):
|
||||
JOIN = "authorizing_official"
|
||||
|
||||
|
||||
def to_database(self, obj):
|
||||
if not self.is_valid():
|
||||
return
|
||||
|
|
|
@ -26,6 +26,7 @@ import re
|
|||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class DomainAddUserForm(forms.Form):
|
||||
"""Form for adding a user to a domain."""
|
||||
|
||||
|
@ -212,6 +213,7 @@ class ContactForm(forms.ModelForm):
|
|||
|
||||
class AuthorizingOfficialContactForm(ContactForm):
|
||||
"""Form for updating authorizing official contacts."""
|
||||
|
||||
JOIN = "authorizing_official"
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
|
|
@ -68,7 +68,7 @@ class Contact(TimeStampedModel):
|
|||
"contact_applications_information",
|
||||
]
|
||||
return any(self._has_more_than_one_join_per_relation(rel, expected_relation) for rel in all_relations)
|
||||
|
||||
|
||||
def _has_more_than_one_join_per_relation(self, relation, expected_relation):
|
||||
"""Helper for finding whether an object is joined more than once."""
|
||||
# threshold is the number of related objects that are acceptable
|
||||
|
@ -96,7 +96,7 @@ class Contact(TimeStampedModel):
|
|||
# the threshold
|
||||
return getattr(self, relation).count() > threshold
|
||||
return False
|
||||
|
||||
|
||||
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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue