diff --git a/rest_framework/compat.py b/rest_framework/compat.py index fa737f42a..c1074b7f8 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -170,19 +170,6 @@ else: super(MaxLengthValidator, self).__init__(*args, **kwargs) -# URLValidator only accepts `message` in 1.6+ -if django.VERSION >= (1, 6): - from django.core.validators import URLValidator -else: - from django.core.validators import URLValidator as DjangoURLValidator - - - class URLValidator(DjangoURLValidator): - def __init__(self, *args, **kwargs): - self.message = kwargs.pop('message', self.message) - super(URLValidator, self).__init__(*args, **kwargs) - - # PATCH method is not implemented by Django if 'patch' not in View.http_method_names: View.http_method_names = View.http_method_names + ['patch'] diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 63e0b2dbf..c44440ecd 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -11,7 +11,7 @@ import uuid from django.conf import settings from django.core.exceptions import ValidationError as DjangoValidationError from django.core.exceptions import ObjectDoesNotExist -from django.core.validators import EmailValidator, RegexValidator, ip_address_validators +from django.core.validators import EmailValidator, RegexValidator, ip_address_validators, URLValidator from django.forms import FilePathField as DjangoFilePathField from django.forms import ImageField as DjangoImageField from django.utils import six, timezone @@ -24,7 +24,7 @@ from django.utils.translation import ugettext_lazy as _ from rest_framework import ISO_8601 from rest_framework.compat import ( MaxLengthValidator, MaxValueValidator, MinLengthValidator, - MinValueValidator, OrderedDict, URLValidator, duration_string, + MinValueValidator, OrderedDict, duration_string, parse_duration, unicode_repr, unicode_to_repr ) from rest_framework.exceptions import ValidationError