mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixes #13511 -- make regex parameter to RegexValidator to be optional. Also tidies up related docs (parameters aren't attributes). Thanks for the patch work, davidfischer.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16351 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -29,8 +29,9 @@ class RegexValidator(object):
|
||||
if code is not None:
|
||||
self.code = code
|
||||
|
||||
# Compile the regex if it was not passed pre-compiled.
|
||||
if isinstance(self.regex, basestring):
|
||||
self.regex = re.compile(regex)
|
||||
self.regex = re.compile(self.regex)
|
||||
|
||||
def __call__(self, value):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user