title: "permission matching query does not exist" errors i encounter with django guardian
body: <p>Am trying to enable my website users block other users they don't want again as friends just like we can on Facebook. I decided to implement it with Django guardian. when a user clicks a button, a view(block_user_view) is called and the profile the user wants to block is added to group which is assigned a custom permission i created(cant_view_profile). But i always get this error &quot;permission matching query doesn't exist&quot;. I can assign these permissions from the admin panel but it runs into error when i try it from my views. I don't know of other ways to actualize this functionality with Django.</p>
  <p>this is my view</p>
  <pre><code>def block_user_view(request, id):
      if request.method == &quot;POST&quot;:
         grouped = Group.objects.get(name=&quot;blockedusers&quot;)
         friend = Profile.objects.get(id = id)
         user = request.user
         assign_perm(&quot;cant_view_profile&quot;, grouped, user)
         friend.groups.add(grouped)
         print(friend.has_perm(&quot;cant_view_profile&quot;, user))
  
      return render(request, &quot;profiles/blockuser.html&quot;, {})
  
  </code></pre>
  <p>my model</p>
  <pre><code>class Profile(models.Model):
      user = models.OneToOneField(User, on_delete= models.CASCADE)
      prof_pics = models.ImageField(null = True, blank =True, upload_to= 'images/')
      friends = models.ManyToManyField(User, blank=True, related_name=&quot;friend&quot; )
      bio = models.TextField(blank= True)
      group = models.ManyToManyField(Group, blank=True,)
   
  
  
      def __str__(self):
          return str(self.user)
  
      
      class Meta:
          permissions = [(&quot;cant_view_profile&quot;,&quot;cant view profile&quot;)]
  </code></pre>