Opened 18 months ago
Last modified 18 months ago
#34644 closed Uncategorized
`get_prep_value` now being called for JSONField — at Version 1
Reported by: | Shaheed Haque | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 4.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
#34539 introduced a change to 4.2.2 which seems to have broken the social_django code I use. AFAIK, the old behaviour was present well before the apparent regression noted in #34539 between 4.1 and 4.2.
I'm not especially knowledgeable about the issues debated above, but here is what I see. First, social_django sets a JSONField extra_data
and then saves the value here:
Second, on the stack, I have the frames shown in the attachment "stack frames". The important point is that when I enter the two new lines of code added in #34539, value
is a dict, but is flattened into a string by the new code. The result is that the database JSONField has the saved string while previously, the dict was saved as expected. I believe that to be incorrect.
(Perhaps the intent here was to only have this change apply to subclasses of JSONField?)
Advice appreciated.
stack frames