title: argument of type 'QuerySet' is not iterable Django error
body: <p>In my webapp, I have a friends feature, but one of the if statements produces an error</p>
  
  <p>Here is my UserProfileInfo model</p>
  
  <pre class="lang-py prettyprint-override"><code>class UserProfileInfo(models.Model):
      connection = models.ManyToManyField(User,blank=True,related_name='follow_profile')
  </code></pre>
  
  <p>And now here is my view:</p>
  
  <pre class="lang-py prettyprint-override"><code>def friend_actions(request,username=None):
      current_user = request.user.userprofileinfo
      user = request.user
      # username = get("username")
      username = User.objects.get(username=username)
      other_user = get_object_or_404(UserProfileInfo,user__username=username)
      # other_user = UserProfileInfo.objects.get(username=username)
      url = other_user.get_absolute_url()
      if other_user in current_user.connection.all():
          current_user.connection.remove(other_user)
      else:
          current_user.connection.add(other_user)
      return HttpResponseRedirect(url)
  </code></pre>
  
  <p>However, this produces the following error:</p>
  
  <blockquote>
    <p>argument of type 'QuerySet' is not iterable</p>
  </blockquote>
  
  <p>Full traceback</p>
  
  <pre><code>Traceback:
  
  File "C:\Users\User\.virtualenvs\interests-site-Ho6yLlHE\lib\site-packages\django\core\handlers\exception.py" in inner
    34.             response = get_response(request)
  
  File "C:\Users\User\.virtualenvs\interests-site-Ho6yLlHE\lib\site-packages\django\core\handlers\base.py" in _get_response
    115.                 response = self.process_exception_by_middleware(e, request)
  
  File "C:\Users\User\.virtualenvs\interests-site-Ho6yLlHE\lib\site-packages\django\core\handlers\base.py" in _get_response
    113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)
  
  File "C:\Users\User\interests-site\interests-drf\mainapp\views.py" in friend_actions
    453.     if other_user in current_user.connection.all():
  
  Exception Type: TypeError at /mainapp/profile/donnellan0007/connect/
  Exception Value: argument of type 'QuerySet' is not iterable
  </code></pre>
  
  <p>I am wondering how I can stop this error from occurring. I have been stumped by it all day</p>