-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Partial update (PATCH) should return new values after successful save #2284
Comments
You gotta give us a hand here? Replicable example? |
We don't necessarily need to see a failing test case, just some more information that demonstrates a failing example. As it stand 'PATCH' is broken isn't something I'm going to spend any time looking at unless I've got more confidence that there's actually a case for me to follow up here. (Ideally demonstrate the issue at the level of the serializer API rather than having to use a who view to replicate.) |
So the example is this. serializer
viewset
urls.py
When I make a patch request to update the value, the value gets saved, but the response has the old value. |
Created a project to test this, but doesn't replicate for me.
Would really need to see something like a pull request for a failing example - seem more feasible that it's some kind of usage issue? |
Huh, maybe, but spent quite some time with this and it always returned the old value. I will try to isolate the problem. |
The problem occurred when I updated to 3. from 2. |
Best thing would prob be to try writing up a failing test case. Alternatively if you throw up a repo that demonstrates the issue then we could spend more time looking at whatever issue your having. |
@hadalin — You must be accessing |
Yes, in
|
Nicely dealt with @carltongibson.
That's your problem there. You shouldn't (don't need to) be accessing
If you want to mark the error as being against
|
OK — that's going to be a "Don't hold it that way". The reason it's okay in v2.x is that we explicitly worked round this in #1117. You could use |
See also #2276. |
Opened #2289 to improve the constraints around this - eg raise a helpful error when this is attempted. |
Thanks. |
When I try to use use partial update, the values are saved correctly but response has old values.
I think the problem is somewhere in UpdateModelMixin.
The text was updated successfully, but these errors were encountered: