Closed harris-irfan closed 1 year ago
Which version of django-admin-confirm
are you using?
There has been multiple issues with file/image fields. I will need to dig in deeper to understand how to safely pass the request.FILES
through the confirmation page
@TrangPham I'm using the latest version 0.2.3.
@harris-irfan I've uploaded a new version with updated file caching. Could you retry the failing upload with v0.2.4? Thanks I would really appreciate that
This should be fixed in the latest version. I am closing this issue due to inactivity.
Steps to reproduce:
In a model, let us say Model A, add an image field:
image = models.ImageField()
Set the following in the ModelAdmin using the AdminConfirmMixin:
confirm_change = True confirm_add = True
Add a new entry from Django admin against Model A and choose an image.
Submit the form.
Submit the confirmation form.
The following error will be displayed on the console and the confirmation form will not be submitted:
"An invalid form control with name='image' is not focusable."
The same error occurs if you modify the image field in an existing entry.
Note:
get_confirmation_fields
method of the AdminConfirmMixin.blank=True
in the model field.