mirror of
https://github.com/django/django.git
synced 2025-10-25 14:46:09 +00:00
Fixed #24339 -- Fixed crash with empty DurationField form field.
This commit is contained in:
committed by
Tim Graham
parent
1791a7e75a
commit
8a21d25033
@@ -514,7 +514,8 @@ class DurationField(Field):
|
||||
}
|
||||
|
||||
def prepare_value(self, value):
|
||||
return duration_string(value)
|
||||
if isinstance(value, datetime.timedelta):
|
||||
return duration_string(value)
|
||||
|
||||
def to_python(self, value):
|
||||
if value in self.empty_values:
|
||||
|
||||
Reference in New Issue
Block a user