Skip to content

Commit 9141663

Browse files
author
Rense VanderHoek
committed
DecimalField fix
max_value and min_value are not in kwargs
1 parent 9cb547b commit 9141663

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

rest_framework/fields.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,9 +733,12 @@ def __init__(self, max_digits, decimal_places, coerce_to_string=None, max_value=
733733
self.max_digits = max_digits
734734
self.decimal_places = decimal_places
735735
self.coerce_to_string = coerce_to_string if (coerce_to_string is not None) else self.coerce_to_string
736-
self.max_value = kwargs.pop('max_value', None)
737-
self.min_value = kwargs.pop('min_value', None)
736+
737+
self.max_value = max_value
738+
self.min_value = min_value
739+
738740
super(DecimalField, self).__init__(**kwargs)
741+
739742
if self.max_value is not None:
740743
message = self.error_messages['max_value'].format(max_value=self.max_value)
741744
self.validators.append(MaxValueValidator(self.max_value, message=message))

0 commit comments

Comments
 (0)