Skip to content

Many-to-many fields do not trigger confirmation unless specified in "get_confirmation_fields" method #48

@e-kondr01

Description

@e-kondr01

Describe the bug
I use AdminConfirmMixin and admin.ModelAdmin, setting confirm_change = True. Fields that are not ManyToMany correctly trigger confirmation page. However, my ManyToManyField did not trigger it until I included it in the return value of get_confirmation_fields.

Expected behavior
If no confirmation_fields are specified, then all model fields should trigger confirmation page, even ManyToManyField type ones.

Versions
django-admin-confirm==1.0.0
python 3.11

Additional context
There reason is this line:
https://github.com/TrangPham/django-admin-confirm/blob/main/admin_confirm/admin.py#L58
ManyToManyFields do not appear in model._meta.fields

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions