Refs #26104 -- Replaced unnecessary force_str() with force_text().
This commit is contained in:
parent
4c912d184d
commit
6b258befc2
|
@ -488,7 +488,7 @@ class DurationField(Field):
|
||||||
return None
|
return None
|
||||||
if isinstance(value, datetime.timedelta):
|
if isinstance(value, datetime.timedelta):
|
||||||
return value
|
return value
|
||||||
value = parse_duration(force_str(value))
|
value = parse_duration(force_text(value))
|
||||||
if value is None:
|
if value is None:
|
||||||
raise ValidationError(self.error_messages['invalid'], code='invalid')
|
raise ValidationError(self.error_messages['invalid'], code='invalid')
|
||||||
return value
|
return value
|
||||||
|
|
Loading…
Reference in New Issue