From 497e81f6fa50e04155c64afa7623917e6e4011a9 Mon Sep 17 00:00:00 2001 From: David Kennedy Date: Tue, 24 Oct 2023 15:07:12 -0400 Subject: [PATCH] formatting for linting --- src/registrar/forms/domain.py | 4 ++-- src/registrar/utility/errors.py | 6 +++--- src/registrar/views/domain.py | 32 +++++++------------------------- 3 files changed, 12 insertions(+), 30 deletions(-) diff --git a/src/registrar/forms/domain.py b/src/registrar/forms/domain.py index 93d42e53d..b9aaee566 100644 --- a/src/registrar/forms/domain.py +++ b/src/registrar/forms/domain.py @@ -78,7 +78,7 @@ class DomainNameserverForm(forms.Form): NameserverError( code=nsErrorCodes.GLUE_RECORD_NOT_ALLOWED, nameserver=domain, - ip=ip_list + ip=ip_list, ), ) elif e.code == nsErrorCodes.MISSING_IP: @@ -88,7 +88,7 @@ class DomainNameserverForm(forms.Form): code=nsErrorCodes.MISSING_IP, nameserver=domain, ip=ip_list, - ) + ), ) else: self.add_error("ip", str(e)) diff --git a/src/registrar/utility/errors.py b/src/registrar/utility/errors.py index 1f658b341..41caed837 100644 --- a/src/registrar/utility/errors.py +++ b/src/registrar/utility/errors.py @@ -39,10 +39,10 @@ class GenericError(Exception): """ _error_mapping = { - GenericErrorCodes.CANNOT_CONTACT_REGISTRY: "Update failed. Cannot contact the registry.", - GenericErrorCodes.GENERIC_ERROR: ( - "Value entered was wrong." + GenericErrorCodes.CANNOT_CONTACT_REGISTRY: ( + "Update failed. Cannot contact the registry." ), + GenericErrorCodes.GENERIC_ERROR: ("Value entered was wrong."), } def __init__(self, *args, code=None, **kwargs): diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py index b0f00f03a..a2ca6d8cb 100644 --- a/src/registrar/views/domain.py +++ b/src/registrar/views/domain.py @@ -317,10 +317,7 @@ class DomainNameserversView(DomainFormBaseView): # NamserverErrors *should* be caught in form; if reached here, # there was an uncaught error in submission (through EPP) messages.error( - self.request, - NameserverError( - code=nsErrorCodes.UNABLE_TO_UPDATE_DOMAIN - ) + self.request, NameserverError(code=nsErrorCodes.UNABLE_TO_UPDATE_DOMAIN) ) logger.error(f"Nameservers error: {Err}") # TODO: registry is not throwing an error when no connection @@ -328,17 +325,12 @@ class DomainNameserversView(DomainFormBaseView): if Err.is_connection_error(): messages.error( self.request, - GenericError( - code=GenericErrorCodes.CANNOT_CONTACT_REGISTRY - ) + GenericError(code=GenericErrorCodes.CANNOT_CONTACT_REGISTRY), ) logger.error(f"Registry connection error: {Err}") else: messages.error( - self.request, - GenericError( - code=GenericErrorCodes.GENERIC_ERROR - ) + self.request, GenericError(code=GenericErrorCodes.GENERIC_ERROR) ) logger.error(f"Registry error: {Err}") else: @@ -707,9 +699,7 @@ class DomainSecurityEmailView(DomainFormBaseView): if contact is None: messages.error( self.request, - GenericError( - code=GenericErrorCodes.CANNOT_CONTACT_REGISTRY - ) + GenericError(code=GenericErrorCodes.CANNOT_CONTACT_REGISTRY), ) return redirect(self.get_success_url()) @@ -721,25 +711,17 @@ class DomainSecurityEmailView(DomainFormBaseView): if Err.is_connection_error(): messages.error( self.request, - GenericError( - code=GenericErrorCodes.CANNOT_CONTACT_REGISTRY - ) + GenericError(code=GenericErrorCodes.CANNOT_CONTACT_REGISTRY), ) logger.error(f"Registry connection error: {Err}") else: messages.error( - self.request, - GenericError( - code=GenericErrorCodes.GENERIC_ERROR - ) + self.request, GenericError(code=GenericErrorCodes.GENERIC_ERROR) ) logger.error(f"Registry error: {Err}") except ContactError as Err: messages.error( - self.request, - GenericError( - code=GenericErrorCodes.GENERIC_ERROR - ) + self.request, GenericError(code=GenericErrorCodes.GENERIC_ERROR) ) logger.error(f"Generic registry error: {Err}") else: