Skip to content

bugfix: reverse relations on OneToOneField in ModelSerializer

Calum Mackervoy requested to merge one-to-one-reverse into master

Closes https://git.startinblox.com/djangoldp-packages/djangoldp-fcpe/-/issues/2

Scenario: Space has a OneToOne relationship with Circle. I post an object to a Circle including {'space': {'name': 'newSpace'}}. Inside of the serializer, everything seems to work correctly. Inside of the database, nothing is persisted

Fix is to re-set and re-save OneToOne relations

Slightly obscure bug which we seem to have inherited from Django Rest Framework (discussion here). Based on their repository I think that it hasn't been fixed but may have went away with Django 3.0

Edited by Calum Mackervoy

Merge request reports