Opened 11 months ago

Closed 11 months ago

Last modified 11 months ago

#34648 closed Bug (duplicate)

`get_prep_value` now being called for JSONField

Reported by: Shaheed Haque Owned by: nobody
Component: Uncategorized 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

In #34539, a change was made in 4.2.2 which I think causes a regression in the expected/normal behaviour of JSONField. I ought to point out that I have reviewed the discussion in #34539 but I am not sufficiently knowledgeable to say if/how valid the arguments there are.

The behaviour change is in an add-on Django app called social-django, which sets a JSONField called extra_data and then save()s the model instance here:

https://github.com/python-social-auth/social-app-django/blob/8d0a2052d1b22a899454571c62237d23aa25af97/social_django/storage.py#L24

On the stack, I have the frames show in the attachment "stack frame", and the important point is that when I enter the two lines of code added in #34539, the 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 instead of the dict as expected. I believe that to be incorrect.

Please advise.

Attachments (1)

stack.png (45.9 KB ) - added by Shaheed Haque 11 months ago.
stack frames

Download all attachments as: .zip

Change History (4)

by Shaheed Haque, 11 months ago

Attachment: stack.png added

stack frames

comment:1 by Shaheed Haque, 11 months ago

Resolution: invalid
Status: newclosed

comment:2 by Shaheed Haque, 11 months ago

Added by mistake as a duplicate of #34644

comment:3 by Mariusz Felisiak, 11 months ago

Resolution: invalidduplicate
Note: See TracTickets for help on using tickets.
Back to Top