Linter change

This commit is contained in:
zandercymatics 2024-01-18 08:42:51 -07:00
parent 2e4fb737e3
commit c626bd2629
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -31,9 +31,7 @@ class DomainHelper:
"""Attempt to determine if a domain name could be requested."""
# Split into pieces for the linter
cls._throw_err_if_domain_is_not_valid_string(domain)
domain = domain.lower().strip() # type: ignore
domain = cls._check_domain_string(domain)
if domain == "" and not blank_ok:
raise errors.BlankValueError()
@ -58,8 +56,9 @@ class DomainHelper:
return domain
@staticmethod
def _throw_err_if_domain_is_not_valid_string(domain):
"""Throws an error if a domain string is not a string"""
def _check_domain_string(domain):
"""Checks the given domain string, and returns the domain if valid.
Otherwise, throws an error if a domain string is not a string"""
if domain is None:
raise errors.BlankValueError()
@ -67,6 +66,8 @@ class DomainHelper:
if not isinstance(domain, str):
raise errors.InvalidDomainError()
return domain.lower().strip()
@classmethod
def validate_and_handle_errors(cls, domain, return_type, blank_ok=False):
"""