File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 3636import logging
3737from collections import OrderedDict
3838
39- import django
39+ from django import VERSION
4040from django import forms
4141from django .contrib .postgres .utils import prefix_validation_error
4242from django .utils .translation import ugettext as _
4545
4646LOGGER = logging .getLogger (__name__ )
4747
48+ DJANGO21 = VERSION >= (2 , 1 )
49+
4850
4951class CompositeBoundField (forms .BoundField ):
5052 """
@@ -145,7 +147,7 @@ def clean(self, value):
145147 try :
146148 cleaned_data [name ] = field .clean (value .get (name ))
147149 except forms .ValidationError as error :
148- prefix = '%(label)s:' if django . __version__ >= '2.1.0' \
150+ prefix = '%(label)s:' if DJANGO21 \
149151 else '%(label)s: '
150152 errors .append (prefix_validation_error (
151153 error , code = 'field_invalid' ,
You can’t perform that action at this time.
0 commit comments