mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-21 10:16:13 +02:00
linting
This commit is contained in:
parent
19a1d60c13
commit
5d601d6991
4 changed files with 13 additions and 15 deletions
|
@ -80,13 +80,13 @@ class RequestingEntityForm(RegistrarForm):
|
||||||
return self.cleaned_data.get("sub_organization")
|
return self.cleaned_data.get("sub_organization")
|
||||||
|
|
||||||
def clean_requested_suborganization(self):
|
def clean_requested_suborganization(self):
|
||||||
name = self.cleaned_data.get('requested_suborganization')
|
name = self.cleaned_data.get("requested_suborganization")
|
||||||
if name and Suborganization.objects.filter(
|
if (
|
||||||
name__iexact=name,
|
name
|
||||||
portfolio=self.domain_request.portfolio,
|
and Suborganization.objects.filter(
|
||||||
name__isnull=False,
|
name__iexact=name, portfolio=self.domain_request.portfolio, name__isnull=False, portfolio__isnull=False
|
||||||
portfolio__isnull=False
|
).exists()
|
||||||
).exists():
|
):
|
||||||
raise ValidationError(
|
raise ValidationError(
|
||||||
"This suborganization already exists. "
|
"This suborganization already exists. "
|
||||||
"Choose a new name, or select it directly if you would like to use it."
|
"Choose a new name, or select it directly if you would like to use it."
|
||||||
|
|
|
@ -717,10 +717,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
if not value
|
if not value
|
||||||
}
|
}
|
||||||
# Adds a validation error to each missing field
|
# Adds a validation error to each missing field
|
||||||
raise ValidationError({
|
raise ValidationError({k: ValidationError(v, code="required") for k, v in errors_dict.items()})
|
||||||
k: ValidationError(v, code='required')
|
|
||||||
for k, v in errors_dict.items()
|
|
||||||
})
|
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
"""Save override for custom properties"""
|
"""Save override for custom properties"""
|
||||||
|
|
|
@ -869,6 +869,7 @@ class MemberExportTest(MockDbForIndividualTests, MockEppLib):
|
||||||
csv_file.seek(0)
|
csv_file.seek(0)
|
||||||
# Read the content into a variable
|
# Read the content into a variable
|
||||||
csv_content = csv_file.read()
|
csv_content = csv_file.read()
|
||||||
|
self.maxDiff = None
|
||||||
expected_content = (
|
expected_content = (
|
||||||
# Header
|
# Header
|
||||||
"Email,Organization admin,Invited by,Joined date,Last active,Domain requests,"
|
"Email,Organization admin,Invited by,Joined date,Last active,Domain requests,"
|
||||||
|
|
|
@ -417,7 +417,7 @@ class MemberExport(BaseExport):
|
||||||
# Adding a order_by increases output predictability.
|
# Adding a order_by increases output predictability.
|
||||||
# Doesn't matter as much for normal use, but makes tests easier.
|
# Doesn't matter as much for normal use, but makes tests easier.
|
||||||
# We should also just be ordering by default anyway.
|
# We should also just be ordering by default anyway.
|
||||||
members = permissions.union(invitations).order_by("email_display")
|
members = permissions.union(invitations).order_by("email_display", "member_display", "first_name", "last_name")
|
||||||
return convert_queryset_to_dict(members, is_model=False)
|
return convert_queryset_to_dict(members, is_model=False)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue