Open fscherf opened 4 days ago
This PR fixes a compatibility issue with djangocms-versioning-filer 1.3 by adding a conditional check before modifying the file field widget in the FileAdminChangeForm. The change prevents the form from crashing when the file field is not present due to missing permissions.
classDiagram
class FileAdminChangeForm {
+__init__(*args, **kwargs)
+clean()
}
note for FileAdminChangeForm "Added conditional check for 'file' field presence before setting widget"
Change | Details | Files |
---|---|---|
Added a defensive check before modifying the file field widget |
|
filer/admin/fileadmin.py |
When used with djangocms-versioning-filer, the
FileAdminChangeForm
might not have a file field due to missing permissions. Since djangocms-versioning-filer 1.3 the constructor ofFileAdminChangeForm
crashes when opening the change URL of a published image.This patch fixes this issue by adding a check whether the file field is present before overriding it.
Description
Checklist
master
Summary by Sourcery
Fix compatibility issue with djangocms-versioning-filer 1.3 by ensuring the FileAdminChangeForm does not crash when the file field is missing due to permissions.
Bug Fixes:
Tests: