Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12328 update GFK object in clean #13946

Merged
merged 2 commits into from
Oct 3, 2023
Merged

Conversation

arthanson
Copy link
Collaborator

@arthanson arthanson commented Oct 2, 2023

Fixes: #12328

Potentially a bug in DRF, for the GFK field the _id and _type are set correctly but the content_object isn't set jut on return for a creation on REST API calls. We are already going through all the GFK fields in the clean method so this just adds the actual setting of the content_object field. A very slight performance hit changing from checking existence to actually getting the object. Little bit of a hack to work-around the issue, but I can't think of any side-effects this should have.

@arthanson arthanson changed the title DRAFT: 12328 update GFK object in clean 12328 update GFK object in clean Oct 2, 2023
@arthanson arthanson marked this pull request as ready for review October 2, 2023 18:01
Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @arthanson!

@jeremystretch jeremystretch merged commit 6093deb into develop Oct 3, 2023
8 checks passed
@jeremystretch jeremystretch deleted the 12328-update-gfk-field branch October 3, 2023 19:41
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updating a GFK field via API does not return the new value
2 participants