title: updating a user using APIVIEW fails. User object either already exists or creates new user
body: <p>I am using django rest framework and I have created a view to update a user. </p>
  
  <p>Here is my view: </p>
  
  <pre><code>def put(self, request, *args, **kwargs):
      authorization =UserSuitsPermissions().superuser(request.user)
      userpk = kwargs.get('pk', 0)
      user = get_object_or_404(STUser, pk=userpk)
      if not authorization:
          if request.user['id'] == user.id:
              authorization = True
      if authorization:
          serializeddata = UserSerializer(data=request.data)
          if serializeddata.is_valid(raise_exception=True):
              data = serializeddata.validated_data
              user.__dict__.update(**data)
              user.save()
              serialzed = UserSerializer(user)
              return Response(serialzed.data)
      return Response(status=status.HTTP_401_UNAUTHORIZED)
  </code></pre>
  
  <p>now in this linked question they are using a generic view and using the serializer to update the user instance : </p>
  
  <p><a href="https://stackoverflow.com/questions/45128666/django-drf-update-user">Django DRF Update User</a></p>
  
  <p>with the accepted answer being: </p>
  
  <pre><code>def update(self, request, *args, **kwargs):
      serializer = self.serializer_class(request.user, data=request.data, partial=True)
      serializer.is_valid(raise_exception=True)
      serializer.save()
      return Response(serializer.data, status=status.HTTP_200_OK)
  </code></pre>
  
  <p>I am not using a generic view and in truth Im over them. I dont value it. so the question is, how do we update a user object via the api view? </p>
  
  <p>my biggest question is does this line in the accepted answer have relevance to my code? </p>
  
  <pre><code>serializer = self.serializer_class(request.user, data=request.data, partial=True)
  </code></pre>