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
Without that, the change to the To-One relationship never gets saved and committed to the database.
To Reproduce
Define two models, one with a ForeignKey linking it to the other, and two corresponding endpoints with a relationship endpoint between the resources. Attempt to PATCH the To-One direction of the relationship with a related resource. Observe no error, but the relationship does not change.
Expected behavior
The response should be a 204 No Content code with the relationship successfully changed.
The text was updated successfully, but these errors were encountered:
I made a mistake in #54 which prevented models with multiple required To-One relationships from being saved to the DB. Resolved in #56 by putting the save() call in the right place.
Describe the bug
This is REALLY similar to #46, but the fix is totally different...
See https://jsonapi.org/format/#crud-updating-to-one-relationships
Specifically, this case:
Isn't working properly.
This is a regression created in #29 by removing this line: https://github.com/Vacasa/drf-jsonapi/pull/32/files#diff-9a2180fee48df47db205fc59be17fa76L380
Without that, the change to the To-One relationship never gets saved and committed to the database.
To Reproduce
Define two models, one with a
ForeignKey
linking it to the other, and two corresponding endpoints with a relationship endpoint between the resources. Attempt toPATCH
the To-One direction of the relationship with a related resource. Observe no error, but the relationship does not change.Expected behavior
The response should be a
204 No Content
code with the relationship successfully changed.The text was updated successfully, but these errors were encountered: