[Answer]-Saving OneToOne to User with Update View

1👍

You’re saving the form in your view and adding the user, but then you’re still calling the superclass form_valid, which does the same thing again, without your user.

Instead of doing that save, see the documentation on how to set the user there.

Edit Sorry, I misread your question. The problem is actually that you need to set the user to the model instance returned by form.save, not on the form itself.

        profile = profile_form.save(commit=False)
        profile.user = self.request.user
        profile.save()

Leave a comment