Commit c8a8021
committed
[qa] Display map widget for readonly users in Django 6.0
Django 6.0 changed how readonly fields are handled in the admin. Setting
read_only=True on a widget no longer renders the widget - instead it shows
only plain text values.
The recommended approach for Django 6.0+ is to disable the field instead
of marking it readonly. This allows the widget to render fully while
preventing editing, giving readonly users an interactive but non-editable
view of the field (e.g., a functional but non-interactive map).
Changes:
- Modify ReadOnlyMixin.set_readonly_attribute() to use field.disabled=True
- Keep read_only attribute on widget for backwards compatibility
- Add explanatory comments about Django 6.0 behavior change
- All 58 tests pass including readonly field tests
This preserves the intended UX where view-only users can see interactive
map widgets while being prevented from making changes.1 parent d1cc0e1 commit c8a8021
1 file changed
+17
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
27 | 33 | | |
28 | 34 | | |
29 | 35 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
34 | 43 | | |
35 | 44 | | |
36 | 45 | | |
| |||
41 | 50 | | |
42 | 51 | | |
43 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
44 | 56 | | |
45 | 57 | | |
46 | 58 | | |
| |||
0 commit comments