1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #20594 -- Add validation to models.SlugField.

Thanks carbonXT for the report.
This commit is contained in:
Baptiste Mispelon
2013-06-13 18:37:08 +02:00
committed by Tim Graham
parent 675558d00e
commit dc9c359546
4 changed files with 9 additions and 6 deletions

View File

@@ -638,10 +638,7 @@ class URLField(CharField):
default_error_messages = {
'invalid': _('Enter a valid URL.'),
}
def __init__(self, max_length=None, min_length=None, *args, **kwargs):
super(URLField, self).__init__(max_length, min_length, *args, **kwargs)
self.validators.append(validators.URLValidator())
default_validators = [validators.URLValidator()]
def to_python(self, value):