[Fixed]-Direct assignment to the reverse side of a related set is prohibited. Use addresses.set() instead

8👍

Your issue is with this line

profile.addresses = profile_data.get('addresses', profile.addresses)

As the error message suggests, direct assignment to the reverse side of a relation is not allowed. What you want to do is use set() instead.

profile.addresses.set([list of new addresses])

https://docs.djangoproject.com/en/dev/ref/models/relations/#django.db.models.fields.related.RelatedManager.set

👤jpm

-2👍

romoving this line may solve your problem:

profile.addresses = profile_data.get('addresses', profile.addresses)

Leave a comment