Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def mock_pdns_get_zones(mocker):
rval = [
'example.com.',
'example.org.',
] + [f'example{i}.org' for i in range(500)]
] + [f'example{i}.org' for i in range(500)] + ['localhost.']
return mocker.patch('dino.pdns_api.pdns.get_zones', return_value=rval)


Expand Down
2 changes: 1 addition & 1 deletion src/dino/zoneeditor/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class ZoneNameValidator(RegexValidator):
hostname_re = r'[_a-z' + URLValidator.ul + r'0-9](?:[a-z' + URLValidator.ul + r'0-9-]{0,61}[a-z' + URLValidator.ul + r'0-9])?'
# identical to URLValidator.domain_re, except for leading underscroes
domain_re = r'(?:\.(?!-)[_a-z' + URLValidator.ul + r'0-9-]{1,63}(?<!-))*'
unanchored_regex = fr'{hostname_re}{domain_re}{URLValidator.tld_re}'
unanchored_regex = fr'({hostname_re}{domain_re}{URLValidator.tld_re}|{URLValidator.tld_re[1:]})'
regex = fr'^{unanchored_regex}\Z'


Expand Down