Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #721 -- isAlphaNumericURL validator now allows dashes

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2353 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit cf528aa420344ceb6ed72f517002f0cf5fbd2111 1 parent 72a83f8
Adrian Holovaty authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  django/core/validators.py
4  django/core/validators.py
@@ -13,7 +13,7 @@
13 13
 _datere = r'(19|2\d)\d{2}-((?:0?[1-9])|(?:1[0-2]))-((?:0?[1-9])|(?:[12][0-9])|(?:3[0-1]))'
14 14
 _timere = r'(?:[01]?[0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9])?'
15 15
 alnum_re = re.compile(r'^\w+$')
16  
-alnumurl_re = re.compile(r'^[\w/]+$')
  16
+alnumurl_re = re.compile(r'^[-\w/]+$')
17 17
 ansi_date_re = re.compile('^%s$' % _datere)
18 18
 ansi_time_re = re.compile('^%s$' % _timere)
19 19
 ansi_datetime_re = re.compile('^%s %s$' % (_datere, _timere))
@@ -63,7 +63,7 @@ def isAlphaNumeric(field_data, all_data):
63 63
 
64 64
 def isAlphaNumericURL(field_data, all_data):
65 65
     if not alnumurl_re.search(field_data):
66  
-        raise ValidationError, _("This value must contain only letters, numbers, underscores and slashes.")
  66
+        raise ValidationError, _("This value must contain only letters, numbers, underscores, dashes or slashes.")
67 67
 
68 68
 def isSlug(field_data, all_data):
69 69
     if not slug_re.search(field_data):

0 notes on commit cf528aa

Please sign in to comment.
Something went wrong with that request. Please try again.