﻿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
29947	Inlines containing a field with default value are considered empty and not saved	ksl	nobody	"== Abstract

Bug is located in the admin app, in the change form of a model. It prevents adding an inline object when the inline contains only fields with their default values.

== Steps to reproduce

* Using the tutorial's project, with the following modifications :

{{{
# models.py
from django.db import models


class Question(models.Model):
    question_text = models.CharField(max_length=200)


class Choice(models.Model):
    CHOICE_ANSWER = ((""y"", ""Yes""),
                     (""n"", ""No""),
                     (""m"", ""Maybe""),
                     )

    question = models.ForeignKey(Question, on_delete=models.CASCADE)
    answer = models.CharField(""answer"", max_length=2, choices=CHOICE_ANSWER, default=""y"")

# admin.py
from django.contrib import admin

from .models import Choice, Question


class ChoiceInline(admin.TabularInline):
    model = Choice
    extra = 0


class QuestionAdmin(admin.ModelAdmin):
    inlines = [ChoiceInline]


admin.site.register(Question, QuestionAdmin)
}}}

* In the admin, create a new question object
* Add a new choice inline
* Leave choice's default value (""Yes"")
* Save the question object

== Result

The question object is saved without its choice inline.

== Expected result

The choice inline of the created question object should be saved, no matter its value (default or not).

== Versions affected

At least 2.0.2, 2.1.2 and 2.1.3."	Bug	closed	contrib.admin	2.1	Normal	wontfix	inline default		Unreviewed	0	0	0	0	0	0
