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

Field _default_translatable_fields leaks through save() and refresh(), breaking context.reset() later on #69

Open
pakal opened this issue Aug 3, 2020 · 0 comments

Comments

@pakal
Copy link

pakal commented Aug 3, 2020

Describe the bug
In the context of Django Rest Framework for example, "_default_translatable_fields" is populated when queryset loads the instance, modifying it and saving it doesn't change this "_default_translatable_fields" later, so doing a context.reset() later reverts all changes to the instance, even those committed to DB.

To Reproduce
For example if django-translations is used in django-rest-framework, and a post-save signal is used in an update() view call, to automatically update translatiions using a translator webservice, then in the end the instance returned has been reverted to the state before the update().

Expected behavior
We expect context.reset() to get the instance back to the state at the start of the Context(), or maybe revert it to its DB state (like a refresh_from_db()), but not to revert it to a far state form a previous Context() use.

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

No branches or pull requests

1 participant