title: Get current_user['id'] if user is anonymous
body: <p>I try to get the current user id with <code>current_user['id']</code>.  I get <code>TypeError: 'AnonymousUser' object has not attribute __getitem__</code> even though I use <code>current_user.is_authenticated()</code> in the template and show a message if the user is not authenticated.  On other methods when I don't use <code>current_user['id']</code> I get the  proper message if the user is not authenticated.  Why am I getting this error?</p>
  
  <pre><code>def patients(self):
      get_doctor_id = str(current_user['id']); 
  </code></pre>