You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: