mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-26 04:28:39 +02:00
Fix linter
This commit is contained in:
parent
82603f57ff
commit
e12598bf20
2 changed files with 17 additions and 20 deletions
|
@ -11,7 +11,6 @@ applications:
|
||||||
command: ./run.sh
|
command: ./run.sh
|
||||||
health-check-type: http
|
health-check-type: http
|
||||||
health-check-http-endpoint: /health
|
health-check-http-endpoint: /health
|
||||||
health-check-invocation-timeout: 30
|
|
||||||
env:
|
env:
|
||||||
# Send stdout and stderr straight to the terminal without buffering
|
# Send stdout and stderr straight to the terminal without buffering
|
||||||
PYTHONUNBUFFERED: yup
|
PYTHONUNBUFFERED: yup
|
||||||
|
|
|
@ -704,20 +704,17 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
auth_info = contact.auth_info
|
auth_info = contact.auth_info
|
||||||
postal_info = contact.postal_info
|
postal_info = contact.postal_info
|
||||||
addr = postal_info.addr
|
addr = postal_info.addr
|
||||||
streets = {}
|
# 'zips' two lists together.
|
||||||
if addr is not None and addr.street is not None:
|
# For instance, (('street1', 'some_value_here'),
|
||||||
# 'zips' two lists together.
|
# ('street2', 'some_value_here'))
|
||||||
# For instance, (('street1', 'some_value_here'),
|
# Dict then converts this to a useable kwarg which we can pass in
|
||||||
# ('street2', 'some_value_here'))
|
streets = dict(
|
||||||
# Dict then converts this to a useable kwarg which we can pass in
|
zip_longest(
|
||||||
streets = dict(
|
["street1", "street2", "street3"],
|
||||||
zip_longest(
|
addr.street if addr is not None else [],
|
||||||
["street1", "street2", "street3"],
|
fillvalue=None,
|
||||||
addr.street,
|
|
||||||
fillvalue=None,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
desired_contact = PublicContact(
|
desired_contact = PublicContact(
|
||||||
domain=self,
|
domain=self,
|
||||||
contact_type=contact_type,
|
contact_type=contact_type,
|
||||||
|
@ -725,13 +722,14 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
email=contact.email or "",
|
email=contact.email or "",
|
||||||
voice=contact.voice or "",
|
voice=contact.voice or "",
|
||||||
fax=contact.fax,
|
fax=contact.fax,
|
||||||
pw=auth_info.pw or "",
|
|
||||||
name=postal_info.name or "",
|
name=postal_info.name or "",
|
||||||
org=postal_info.org,
|
org=postal_info.org,
|
||||||
city=addr.city or "",
|
# For linter - default to "" instead of None
|
||||||
pc=addr.pc or "",
|
pw=getattr(auth_info, 'pw', ""),
|
||||||
cc=addr.cc or "",
|
city=getattr(addr, 'city', ""),
|
||||||
sp=addr.sp or "",
|
pc=getattr(addr, 'pc', ""),
|
||||||
|
cc=getattr(addr, 'cc', ""),
|
||||||
|
sp=getattr(addr, 'sp', ""),
|
||||||
**streets,
|
**streets,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -753,7 +751,7 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
|
|
||||||
def generic_contact_getter(
|
def generic_contact_getter(
|
||||||
self, contact_type_choice: PublicContact.ContactTypeChoices
|
self, contact_type_choice: PublicContact.ContactTypeChoices
|
||||||
) -> PublicContact:
|
) -> PublicContact | None:
|
||||||
"""Abstracts the cache logic on EppLib contact items
|
"""Abstracts the cache logic on EppLib contact items
|
||||||
|
|
||||||
contact_type_choice is a literal in PublicContact.ContactTypeChoices,
|
contact_type_choice is a literal in PublicContact.ContactTypeChoices,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue