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

Reload for prefetch_related updates may fail if object is filtered out. #4661

Closed
tomchristie opened this issue Nov 7, 2016 · 0 comments
Closed
Labels
Milestone

Comments

@tomchristie
Copy link
Member

tomchristie commented Nov 7, 2016

In the awkward case where prefetch_related has been applied to an update operation, we are required to refresh the instance from the database (see #4553)

The current implementation re-calls get_object(). We should instead call refresh_from_db directly on the model instance. This means that we don't have a potential case of get_object returning None because the update itself has effectively removed the object from the base queryset causing the lookup to fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant