Open e-kondr01 opened 1 year ago
Ah thanks for such a great bug report!
I'd be very happy to review a change from you or others. Marking as a good starter ticket.
A futher note is that after you explicitly specify a M2M field in confirmation_fields, every save will trigger the confirmation page, even if no data has been changed.
Describe the bug I use
AdminConfirmMixin
andadmin.ModelAdmin
, settingconfirm_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 ofget_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