Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
e625cff8
Commit
e625cff8
authored
Sep 21, 2015
by
Carlton Gibson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Django 1.5 URLValidator fallback
parent
9216dc9a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
15 deletions
+2
-15
rest_framework/compat.py
+0
-13
rest_framework/fields.py
+2
-2
No files found.
rest_framework/compat.py
View file @
e625cff8
...
...
@@ -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'
]
...
...
rest_framework/fields.py
View file @
e625cff8
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment