mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-30 13:03:14 +02:00
updated error handling and message for key tag
This commit is contained in:
parent
42ae02a2d4
commit
5ae613fba3
2 changed files with 2 additions and 2 deletions
|
@ -680,7 +680,7 @@ class DomainDsdataForm(forms.Form):
|
||||||
key_tag = cleaned_data.get("key_tag", 0)
|
key_tag = cleaned_data.get("key_tag", 0)
|
||||||
try:
|
try:
|
||||||
key_tag = int(key_tag)
|
key_tag = int(key_tag)
|
||||||
if key_tag < 0 or key_tag > 65535:
|
if key_tag <= 0 or key_tag > 65535:
|
||||||
self.add_error(
|
self.add_error(
|
||||||
"key_tag",
|
"key_tag",
|
||||||
DsDataError(code=DsDataErrorCodes.INVALID_KEYTAG_SIZE),
|
DsDataError(code=DsDataErrorCodes.INVALID_KEYTAG_SIZE),
|
||||||
|
|
|
@ -262,7 +262,7 @@ class DsDataError(Exception):
|
||||||
DsDataErrorCodes.INVALID_DIGEST_SHA1: ("SHA-1 digest must be exactly 40 characters."),
|
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_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_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)."),
|
DsDataErrorCodes.INVALID_KEYTAG_CHARS: ("Key tag must be numeric (0-9)."),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue