﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24339	Exception at /add admin view when using DurationField	Michael Angeletti	nobody	"== Setup ==

Make an app with a model that has a `DurationField`. (started fresh app to verify)

== Exception ==

{{{AttributeError: 'NoneType' object has no attribute 'days'}}} was the error message.

== Cause ==

https://github.com/django/django/blob/0ed7d155635da9f79d4dd67e4889087d3673c6da/django/forms/fields.py#L517 (assumes {{{value}}} is a {{{timedelta}}})

== Solution ==

{{{
    def prepare_value(self, value):
        if isinstance(value, datetime.timedelta):
            return duration_string(value)
        return value
}}}"	Bug	closed	Forms	1.8alpha1	Release blocker	fixed			Ready for checkin	1	0	0	0	1	0
