Skip to content

Bug: setting reverse OtO is not persisted #7994

@pierremonico

Description

@pierremonico

Hi

I have an issue where I have two models A and B. B has a OneToOne field called a pointing to the A model, with related_name set to b.

Whenever I create A objects through the API and set the JSON b field to the ID of an existing B object, I get a 201 response (with the b key correctly set in the response body), but this relationship is actually not persisted in the database .

I have created a repo with a minimal implementation where this can be reproduced. It also includes a failing test.

I believe following issues/MRs reference the same problem, but I can't tell for sure:

Originally posted by @pierremonico in #7987

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions