Skip to content

Deleting temporary elements in Many To Many list causes graphical and functional bug #264

@Riccardo-Maffei

Description

@Riccardo-Maffei

Maybe a duplicate of #212 , but I think there still are some differences, therefore I created this new issue. In order to reproduce the bug, a models.ManyToManyField with a through property has to be created. The Model referenced in the "through" should have an Inline class, setting all its fields to autocomplete mode.

Then the user has to create a few empty M2M fields in the admin site,
image

delete one or more in the middle of the list
image

and add a new one.
image

At this point the newly created element can still be deleted, but the autocomplete function won't work on this field anymore, making the input of new data in this field impossible.

Up until now I've found two manual fixes, either adding one field at a time or removing empty fields only if they are at the end of the list. These strategies could be a bit annoying however, especially for people that need to enter information quickly.

I will include pieces of my code in the comments, in case this isn't a bug and it was me who made a mistake.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions