title: Matching query does not exist issue Django
body: <p>I am trying to create a web app that has a Like button option for the Post. Everything works fine but when I click on the Like button it shows DoesNotExist error.</p>
  <p>This is the model part of the code:</p>
  <pre><code>class Like(models.Model): 
      user = models.ForeignKey(Yatru, on_delete=models.CASCADE)
      location = models.ForeignKey(Post, on_delete=models.CASCADE)
      value = models.CharField(choices=LIKE_CHOICES, max_length=8)
      updated = models.DateTimeField(auto_now=True)
      created = models.DateTimeField(auto_now_add=True)
      
      def __str__(self):
          return f&quot;{self.user}-{self.location}-{self.value}&quot;
  </code></pre>
  <p>This is the views:</p>
  <pre><code>def like_unlike(request):
      user = request.user 
      if request.method == 'POST':
          location_id = request.POST.get('location_id')
          location_obj = Post.objects.get(id=location_id)
          profile = Yatru.objects.get(user=user)
  
          if profile in location_obj.liked.all():
              location_obj.liked.remove(profile)
          else:
              location_obj.liked.add(profile)
          
          like, created = Like.objects.get_or_create(user=profile, location_id=location_id)
  
          if not created:
              if like.value=='Like':
                  like.value='Unlike'
              else:
                  like.value='Like'
              
              location_obj.save()
              like.save()
      return redirect('posts:post_views')
  </code></pre>
  <p>When I try to load the page it shows this error:</p>
  <blockquote>
  <p>DoesNotExist at /posts/liked</p>
  </blockquote>