diff options
| author | Michael Angeletti <michael@angelettigroup.com> | 2015-02-13 17:12:23 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-02-14 07:37:18 -0500 |
| commit | 8a21d250334f56845f255be5534b01d8c6eda314 (patch) | |
| tree | cd5fc26aa22115d78c867a32df61df8b8594ad5d /django/forms/fields.py | |
| parent | 1791a7e75af8c9e7ca54425592379fd1f840fe88 (diff) | |
Fixed #24339 -- Fixed crash with empty DurationField form field.
Diffstat (limited to 'django/forms/fields.py')
| -rw-r--r-- | django/forms/fields.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/forms/fields.py b/django/forms/fields.py index cca2091ffa..09e20617ad 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -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: |
