Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove Django 1.5 URLValidator fallback
  • Loading branch information
Carlton Gibson committed Sep 21, 2015
commit e625cff8a5e4e4353d280fdd4c305dc6dbeed999
13 changes: 0 additions & 13 deletions rest_framework/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,6 @@ def __init__(self, *args, **kwargs):
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']
Expand Down
4 changes: 2 additions & 2 deletions rest_framework/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
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
Expand All @@ -24,7 +24,7 @@
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
Expand Down