1
If EditProfileForm
is editing the UserDetail
, then instance
should be a UserDetail
instance. You are currently passing the user
instead. Try changing it to:
def post(self, request, *args, **kwargs):
user_id = kwargs.get('pk')
user_detail = User.objects.get(id=user_id)
user_detail = user.userdetail
form = EditProfileForm(request.POST, request.FILES, instance=user_detail)
Source:stackexchange.com