Changes between Initial Version and Version 3 of Ticket #32336
- Timestamp:
- Jan 9, 2021, 7:14:40 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #32336
- Property Owner changed from to
- Property Has patch set
-
Ticket #32336 – Description
initial v3 38 38 === Proposed Solution === 39 39 Cache the return value of `get_readonly_fields` in some instance variable `self._readonly_fields`, and reset this value at the beginning of every request. This way the various variables that store readonly fields will all be referring to the same objects. For `InlineModelAdmin`s the value of `self._readonly_fields` would need to be set to `None` on instantiation (which happens for every new change view request). 40 41 === Tests === 42 I'm not sure if this needs a separate test. I have adapted `PostAdmin` (used in lots of admin tests, in particular the ones that test readonly_fields) to cater for this case. So although no tests are added, there are plenty of failing tests before the fix.