mirror of
https://github.com/django/django.git
synced 2025-03-06 15:32:33 +00:00
Removed unnecessary force_text() in BaseTemporalField.to_python().
This seems unneeded since its introduction in da3aa22d04d6452f87abbb1a0fee8a90a61eff5b.
This commit is contained in:
parent
d1bab24e01
commit
af598187ec
@ -390,12 +390,8 @@ class BaseTemporalField(Field):
|
|||||||
self.input_formats = input_formats
|
self.input_formats = input_formats
|
||||||
|
|
||||||
def to_python(self, value):
|
def to_python(self, value):
|
||||||
# Try to coerce the value to unicode.
|
value = value.strip()
|
||||||
unicode_value = force_text(value, strings_only=True)
|
# Try to strptime against each input format.
|
||||||
if isinstance(unicode_value, str):
|
|
||||||
value = unicode_value.strip()
|
|
||||||
# If unicode, try to strptime against each input format.
|
|
||||||
if isinstance(value, str):
|
|
||||||
for format in self.input_formats:
|
for format in self.input_formats:
|
||||||
try:
|
try:
|
||||||
return self.strptime(value, format)
|
return self.strptime(value, format)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user