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
91416632
Commit
91416632
authored
Feb 21, 2015
by
Rense VanderHoek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DecimalField fix
max_value and min_value are not in kwargs
parent
9cb547b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
rest_framework/fields.py
+5
-2
No files found.
rest_framework/fields.py
View file @
91416632
...
@@ -733,9 +733,12 @@ class DecimalField(Field):
...
@@ -733,9 +733,12 @@ class DecimalField(Field):
self
.
max_digits
=
max_digits
self
.
max_digits
=
max_digits
self
.
decimal_places
=
decimal_places
self
.
decimal_places
=
decimal_places
self
.
coerce_to_string
=
coerce_to_string
if
(
coerce_to_string
is
not
None
)
else
self
.
coerce_to_string
self
.
coerce_to_string
=
coerce_to_string
if
(
coerce_to_string
is
not
None
)
else
self
.
coerce_to_string
self
.
max_value
=
kwargs
.
pop
(
'max_value'
,
None
)
self
.
min_value
=
kwargs
.
pop
(
'min_value'
,
None
)
self
.
max_value
=
max_value
self
.
min_value
=
min_value
super
(
DecimalField
,
self
)
.
__init__
(
**
kwargs
)
super
(
DecimalField
,
self
)
.
__init__
(
**
kwargs
)
if
self
.
max_value
is
not
None
:
if
self
.
max_value
is
not
None
:
message
=
self
.
error_messages
[
'max_value'
]
.
format
(
max_value
=
self
.
max_value
)
message
=
self
.
error_messages
[
'max_value'
]
.
format
(
max_value
=
self
.
max_value
)
self
.
validators
.
append
(
MaxValueValidator
(
self
.
max_value
,
message
=
message
))
self
.
validators
.
append
(
MaxValueValidator
(
self
.
max_value
,
message
=
message
))
...
...
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