File tree Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -277,12 +277,6 @@ def md_filter_add_syntax_highlight(md):
277
277
LONG_SEPARATORS = (b', ' , b': ' )
278
278
INDENT_SEPARATORS = (b',' , b': ' )
279
279
280
- # TODO: Remove
281
- try :
282
- # DecimalValidator is unavailable in Django < 1.9
283
- from django .core .validators import DecimalValidator
284
- except ImportError :
285
- DecimalValidator = None
286
280
287
281
class CustomValidatorMessage (object ):
288
282
"""
Original file line number Diff line number Diff line change 8
8
from django .db import models
9
9
from django .utils .text import capfirst
10
10
11
- from rest_framework .compat import DecimalValidator , postgres_fields
11
+ from rest_framework .compat import postgres_fields
12
12
from rest_framework .validators import UniqueValidator
13
13
14
14
NUMERIC_FIELD_TYPES = (
@@ -181,11 +181,10 @@ def get_field_kwargs(field_name, model_field):
181
181
if validator is not validators .validate_ipv46_address
182
182
]
183
183
# Our decimal validation is handled in the field code, not validator code.
184
- # (In Django 1.9+ this differs from previous style)
185
- if isinstance (model_field , models .DecimalField ) and DecimalValidator :
184
+ if isinstance (model_field , models .DecimalField ):
186
185
validator_kwarg = [
187
186
validator for validator in validator_kwarg
188
- if not isinstance (validator , DecimalValidator )
187
+ if not isinstance (validator , validators . DecimalValidator )
189
188
]
190
189
191
190
# Ensure that max_length is passed explicitly as a keyword arg,
You can’t perform that action at this time.
0 commit comments