title: Why do I get an error "object of type 'HttpResponseRedirect' has no len()"?
body: <p>In my Django app i have a class-based view that inherits ListView. get_queryset method is overriden this way:</p>
  
  <pre><code>def get_queryset(self):
          if not 'anonymous_nickname' in self.request.session:
              return HttpResponseRedirect('/')
          filters = {}
          if self.request.user.is_anonymous():
              filters['allow_anonymous_access'] = True
          return CoopRoom.objects.filter(**filters)
  </code></pre>
  
  <p>in order not to let user see list of rooms when he wants to reach them without entering any data on the main page. But instead of performing this redirect:</p>
  
  <pre><code>            return HttpResponseRedirect('/')
  </code></pre>
  
  <p>i get an error "object of type 'HttpResponseRedirect' has no len()". I cannot see the reason why?</p>
  
  <p>Thanks in advance.</p>