title: How to fix `TypeError: 'AnonymousUser' object is not iterable ` in Django
body: <p>I'm using LoginRequiredMixin in Django. However I got error.
  <code>TypeError: 'AnonymousUser' object is not iterable </code></p>
  <p>It happen in this line
  <code>if Speaker.objects.filter(user=self.request.user, is_deleted=False).count() == 0:</code> of this code.</p>
  <pre><code>class SpeakerListView(LoginRequiredMixin, ListView):
      template_name = 'speaker/list.html'
      context_object_name = 'speakers'
      model = Speaker
  
      def dispatch(self, request, *args, **kwargs):
          # if user does not have speaker, redirect to create view
          if Speaker.objects.filter(user=self.request.user, is_deleted=False).count() == 0:
              messages.error(request, _('xxx'))
              return redirect('speech:speaker_add')
          return super().dispatch(request, *args, **kwargs)
  </code></pre>
  <p>If you know, how to solve this problem. Please help me!</p>