added comment

This commit is contained in:
David Kennedy 2023-11-17 06:31:46 -05:00
parent 9785bed065
commit d109f5a265
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B

View file

@ -233,6 +233,12 @@ class DomainDsdataForm(forms.Form):
"""Form for adding or editing DNSSEC DS Data to a domain."""
def validate_hexadecimal(value):
"""
Tests that string matches all hexadecimal values.
Raise validation error to display error in form
if invalid caracters entered
"""
if not re.match(r"^[0-9a-fA-F]+$", value):
raise forms.ValidationError(str(DsDataError(code=DsDataErrorCodes.INVALID_DIGEST_CHARS)))