Duplicated row entries with edit_inline=models.Tabular
|Reported by:||toomim||Owned by:||nobody|
|Cc:||Triage Stage:||Fixed on a branch|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I'm editing a model A with two choice fields inline in a model B, using a 2x5 table.
class PubAuthor(models.Model): author = models.ForeignKey(Person, core=True) author_number = models.IntegerField(core=True, choices=[(1, 1), (2, 2), (3,3), (4,4), (5,5)]) pub = models.ForeignKey('Pub', edit_inline=models.TABULAR, num_in_admin=5, num_extra_on_change=5)
This works, except that if I edit a Pub and set only the FIRST row's author and author_number, and there is only 1 author in the database, then if I reload the page, the admin interface fills every row of the "author" column with that author! The "Author number" column remains empty.
This then gives me a validation error if I try to save it.
This seems to only happen if there's a single author in the database.