title: 'Response' object has no attribute 'user'
body: <p>I am getting error AttributeError: 'Response' object has no attribute 'user' for the below code I have written</p>
  <p>I am trying to get the user info from the context and create a notification model. I am getting the above error while returning the statement. I don't understand why I am getting this error</p>
  <p><em><strong>Model</strong></em></p>
  <pre><code>class CourseNotification(models.Model):
     uid = models.UUIDField(
        primary_key=True,
        default=uuid.uuid4,
        editable=False,
        unique=True)
     course = models.ForeignKey('Course.Course', on_delete=models.SET_NULL, null=True)
     user = models.ManyToManyField('Profile.myUser',null=True)
  
     def get_user(self):
        return [i for i in self.user.all()]
  
     def __str__(self):
        return self.course.course_title
  </code></pre>
  <p><em><strong>View</strong></em></p>
  <pre><code>class CourseNotificationView(ModelViewSet):
      queryset = CourseNotification.objects.all()
      serializer_class = CourseNotificationSerializer
      authentication_classes = [JWTAuthentication]
      permission_classes = [IsAuthenticated]
  
  def get_queryset(self):
      if self.request.user.email is not None:
          profile = myUser.objects.get(email=self.request.user.email)
      if profile is not None:
          notification = CourseNotification.objects.filter(user=profile)
          return notification
      else:
          return Response(data={&quot;User&quot;: &quot;Unauthorized User&quot;}, status=HTTP_401_UNAUTHORIZED)
  
  def retrieve(self, request, *args, **kwargs):
      serializer = self.get_serializer(self.get_queryset(), many=True)
      return Response(data=serializer.data)
  </code></pre>
  <p><em><strong>Serializer</strong></em></p>
  <pre><code>class CourseNotificationSerializer(serializers.ModelSerializer):
      class Meta:
          model = CourseNotification
          fields = '__all__'
  
  def create(self, validated_data):
      users = self.context['request'].user
      subject = validated_data['course']
  
      if users is None and subject is None or subject == &quot;&quot;:
          raise serializers.ValidationError({&quot;Invalid&quot;: &quot;Subject could not be Invalid&quot;})
  
      checkNotification = self.checkNotification(users, subject)
      if checkNotification is not None and checkNotification.status_code == 200:
          return checkNotification
  
      validate_subject = self.validateSubject(users, subject)
      if validate_subject.status_code == 200:
          return validate_subject
  
      get_data = CourseNotification.objects.create(course=subject)
      get_data.user.add(users)
      get_data.save()
      return Response(data=get_data, status=HTTP_201_CREATED, content_type=&quot;application/json&quot;)
  
  @staticmethod
  def checkNotification(users, subject):
      get_data = CourseNotification.objects.filter(user=users, course=subject)
      if get_data:
          for data in get_data:
              data.user.remove(users)
              data.save()
          return Response(data=get_data, status=HTTP_200_OK, content_type=&quot;application/json&quot;)
  
  @staticmethod
  def validateSubject(users, subject):
      get_data = CourseNotification.objects.filter(course=subject).exclude(user=users)
      if get_data:
          subject = CourseNotification.objects.get(course=subject)
          subject.user.add(users)
          subject.save()
      return Response(data=get_data, status=HTTP_200_OK, content_type=&quot;application/json&quot;)
  </code></pre>
  <p>I am trying to add data to the model through API. I am facing the problem</p>