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

"Save with update_fields did not affect any rows" for removed object #32

Open
meteozond opened this issue Jun 9, 2015 · 2 comments
Open
Labels

Comments

@meteozond
Copy link
Contributor

No description provided.

meteozond added a commit that referenced this issue Jun 9, 2015
meteozond added a commit that referenced this issue Jun 9, 2015
@meteozond meteozond added the bug label Mar 22, 2016
@oppianmatt
Copy link

ran into this because django checks using the default manager, see:

    def _do_update(self, base_qs, using, pk_val, values, update_fields, forced_update):
        """
        This method will try to update the model. If the model was updated (in
        the sense that an update query was done and a matching row was found
        from the DB) the method will return True.
        """
        filtered = base_qs.filter(pk=pk_val)
...

That base_qs has filtered out the soft deleted model and so it doesn't think any models were changed

@meteozond
Copy link
Contributor Author

meteozond commented Jan 26, 2017

@oppianmatt Thanks for investigation, looks like _do_update overriding will do the job but I'm still not sure that it is a good idea to allow removed objects manipulations. I need some time to turn over in mind this case.

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

2 participants