diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2006-02-18 22:36:16 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2006-02-18 22:36:16 +0000 |
| commit | cf528aa420344ceb6ed72f517002f0cf5fbd2111 (patch) | |
| tree | cae1ed10bd915fae150ba96208493d68e892b07b /django | |
| parent | 72a83f872c81918b9640eb804f9004fa24b1847c (diff) | |
Fixed #721 -- isAlphaNumericURL validator now allows dashes
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2353 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/validators.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/validators.py b/django/core/validators.py index 1f70192838..4b7fe48e3c 100644 --- a/django/core/validators.py +++ b/django/core/validators.py @@ -13,7 +13,7 @@ import re _datere = r'(19|2\d)\d{2}-((?:0?[1-9])|(?:1[0-2]))-((?:0?[1-9])|(?:[12][0-9])|(?:3[0-1]))' _timere = r'(?:[01]?[0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9])?' alnum_re = re.compile(r'^\w+$') -alnumurl_re = re.compile(r'^[\w/]+$') +alnumurl_re = re.compile(r'^[-\w/]+$') ansi_date_re = re.compile('^%s$' % _datere) ansi_time_re = re.compile('^%s$' % _timere) ansi_datetime_re = re.compile('^%s %s$' % (_datere, _timere)) @@ -63,7 +63,7 @@ def isAlphaNumeric(field_data, all_data): def isAlphaNumericURL(field_data, all_data): if not alnumurl_re.search(field_data): - raise ValidationError, _("This value must contain only letters, numbers, underscores and slashes.") + raise ValidationError, _("This value must contain only letters, numbers, underscores, dashes or slashes.") def isSlug(field_data, all_data): if not slug_re.search(field_data): |
