admin: Inline saves extras when model has choices and a default choice
|Reported by:||rvanlaar||Owned by:||nobody|
|Severity:||Keywords:||admin inline choices save|
|Cc:||rick@… roland@…||Triage Stage:||Unreviewed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When having defined choices and a default such as:
Class Node: status = models.CharField(max_length=10, choices=STATUS_CHOICES, default=1) another_field = models.CharField(max_length=10)
and in the admin:
class NodeInline(admin.TabularInline): model = Node extra = 2
Pressing save will try to save all the extra fields as well even though no changes in the fields of the extras were made.
This leads to validation errors of the unfilled entries.
The admin should know that nothing has changed and not try to save extra inline field that weren't edited.