mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 09:37:03 +02:00
Added linting
This commit is contained in:
parent
3be7680311
commit
01335ff515
2 changed files with 16 additions and 20 deletions
|
@ -176,7 +176,6 @@ class DomainAdmin(ListHeaderAdmin):
|
||||||
readonly_fields = ["state"]
|
readonly_fields = ["state"]
|
||||||
|
|
||||||
def response_change(self, request, obj):
|
def response_change(self, request, obj):
|
||||||
|
|
||||||
GET_SECURITY_EMAIL = "_get_security_email"
|
GET_SECURITY_EMAIL = "_get_security_email"
|
||||||
SET_SECURITY_CONTACT = "_set_security_contact"
|
SET_SECURITY_CONTACT = "_set_security_contact"
|
||||||
MAKE_DOMAIN = "_make_domain_in_registry"
|
MAKE_DOMAIN = "_make_domain_in_registry"
|
||||||
|
@ -187,7 +186,6 @@ class DomainAdmin(ListHeaderAdmin):
|
||||||
REMOVE_CLIENT_HOLD = "_rem_client_hold"
|
REMOVE_CLIENT_HOLD = "_rem_client_hold"
|
||||||
DELETE_DOMAIN = "_delete_domain"
|
DELETE_DOMAIN = "_delete_domain"
|
||||||
|
|
||||||
|
|
||||||
PLACE_HOLD = "_place_client_hold"
|
PLACE_HOLD = "_place_client_hold"
|
||||||
EDIT_DOMAIN = "_edit_domain"
|
EDIT_DOMAIN = "_edit_domain"
|
||||||
if PLACE_HOLD in request.POST:
|
if PLACE_HOLD in request.POST:
|
||||||
|
@ -263,7 +261,6 @@ class DomainAdmin(ListHeaderAdmin):
|
||||||
)
|
)
|
||||||
return HttpResponseRedirect(".")
|
return HttpResponseRedirect(".")
|
||||||
|
|
||||||
|
|
||||||
elif MAKE_NAMESERVERS in request.POST:
|
elif MAKE_NAMESERVERS in request.POST:
|
||||||
try:
|
try:
|
||||||
hosts = [("ns1.example.com", None), ("ns2.example.com", None)]
|
hosts = [("ns1.example.com", None), ("ns2.example.com", None)]
|
||||||
|
|
|
@ -347,7 +347,6 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
# some statuses cannot be set by the client at all
|
# some statuses cannot be set by the client at all
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
|
||||||
@Cache
|
@Cache
|
||||||
def registrant_contact(self) -> PublicContact:
|
def registrant_contact(self) -> PublicContact:
|
||||||
"""Get or set the registrant for this domain."""
|
"""Get or set the registrant for this domain."""
|
||||||
|
@ -369,7 +368,6 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
|
|
||||||
@administrative_contact.setter # type: ignore
|
@administrative_contact.setter # type: ignore
|
||||||
def administrative_contact(self, contact: PublicContact):
|
def administrative_contact(self, contact: PublicContact):
|
||||||
|
|
||||||
logger.info("making admin contact")
|
logger.info("making admin contact")
|
||||||
if contact.contact_type != contact.ContactTypeChoices.ADMINISTRATIVE:
|
if contact.contact_type != contact.ContactTypeChoices.ADMINISTRATIVE:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
|
@ -408,7 +406,9 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
# TODO - consider making this use both add and rem at the same time, separating it out may not be needed
|
# TODO - consider making this use both add and rem at the same time, separating it out may not be needed
|
||||||
# good addition for ticket 850
|
# good addition for ticket 850
|
||||||
|
|
||||||
logger.info("_update_domain_with_contact() received type %s " % contact.contact_type)
|
logger.info(
|
||||||
|
"_update_domain_with_contact() received type %s " % contact.contact_type
|
||||||
|
)
|
||||||
domainContact = epp.DomainContact(
|
domainContact = epp.DomainContact(
|
||||||
contact=contact.registry_id, type=contact.contact_type
|
contact=contact.registry_id, type=contact.contact_type
|
||||||
)
|
)
|
||||||
|
@ -522,7 +522,6 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
# make contact in registry, duplicate and errors handled there
|
# make contact in registry, duplicate and errors handled there
|
||||||
errorCode = self._make_contact_in_registry(contact)
|
errorCode = self._make_contact_in_registry(contact)
|
||||||
|
|
||||||
|
|
||||||
# contact is already added to the domain, but something may have changed on it
|
# contact is already added to the domain, but something may have changed on it
|
||||||
alreadyExistsInRegistry = errorCode == ErrorCode.OBJECT_EXISTS
|
alreadyExistsInRegistry = errorCode == ErrorCode.OBJECT_EXISTS
|
||||||
# if an error occured besides duplication, stop
|
# if an error occured besides duplication, stop
|
||||||
|
@ -828,7 +827,8 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
)
|
)
|
||||||
def ready(self):
|
def ready(self):
|
||||||
"""Transition to the ready state
|
"""Transition to the ready state
|
||||||
domain should have nameservers and all contacts and now should be considered live on a domain"""
|
domain should have nameservers and all contacts and now should be considered live on a domain
|
||||||
|
"""
|
||||||
# TODO - in nameservers tickets 848 and 562 check here if updates need to be made
|
# TODO - in nameservers tickets 848 and 562 check here if updates need to be made
|
||||||
nameserverList = self.nameservers
|
nameserverList = self.nameservers
|
||||||
logger.info("Changing to ready state")
|
logger.info("Changing to ready state")
|
||||||
|
@ -1008,7 +1008,6 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
{k: v for k, v in contact.items() if v is not ...}
|
{k: v for k, v in contact.items() if v is not ...}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# get nameserver info, if there are any
|
# get nameserver info, if there are any
|
||||||
if (
|
if (
|
||||||
# fetch_hosts and
|
# fetch_hosts and
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue