diff --git a/src/registrar/forms/domain.py b/src/registrar/forms/domain.py index fd6dafb1f..2a62be15a 100644 --- a/src/registrar/forms/domain.py +++ b/src/registrar/forms/domain.py @@ -680,7 +680,7 @@ class DomainDsdataForm(forms.Form): key_tag = cleaned_data.get("key_tag", 0) try: key_tag = int(key_tag) - if key_tag < 0 or key_tag > 65535: + if key_tag <= 0 or key_tag > 65535: self.add_error( "key_tag", DsDataError(code=DsDataErrorCodes.INVALID_KEYTAG_SIZE), diff --git a/src/registrar/utility/errors.py b/src/registrar/utility/errors.py index eccd118f8..dac730705 100644 --- a/src/registrar/utility/errors.py +++ b/src/registrar/utility/errors.py @@ -262,7 +262,7 @@ class DsDataError(Exception): DsDataErrorCodes.INVALID_DIGEST_SHA1: ("SHA-1 digest must be exactly 40 characters."), DsDataErrorCodes.INVALID_DIGEST_SHA256: ("SHA-256 digest must be exactly 64 characters."), DsDataErrorCodes.INVALID_DIGEST_CHARS: ("Digest must contain only alphanumeric characters (0-9, a-f)."), - DsDataErrorCodes.INVALID_KEYTAG_SIZE: ("Key tag must be less than 65535."), + DsDataErrorCodes.INVALID_KEYTAG_SIZE: ("Key tag must be greater than 0 and less than 65535."), DsDataErrorCodes.INVALID_KEYTAG_CHARS: ("Key tag must be numeric (0-9)."), }