title: request.user returns a SimpleLazyObject, how do I "wake" it?
body: <p>I have the following method:</p>
  
  <pre><code>def _attempt(actor):
      if actor.__class__ != User:
          raise TypeError
  </code></pre>
  
  <p>Which is called from a view:</p>
  
  <pre><code>self.object.attempt(self.request.user)
  </code></pre>
  
  <p>As you can see, the _attempt method expects actor to be type <code>django.contrib.auth.models.User</code>, however the object appears to be of type <code>django.utils.functional.SimpleLazyObject</code>. Why is this so? And more importantly, how can I convert the <code>LazyObject</code> (which apparently is a kind of wrapper for a User object) into a <code>User</code> object?</p>
  
  <p>More info on <code>Request.user</code> is available here: <a href="https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.user" rel="noreferrer">https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.user</a> This documentation seems to indicate the <code>request.user</code> should be a <code>User</code> object...</p>
  
  <p>======Post-edit=====</p>
  
  <p>I've got the following method now: </p>
  
  <pre><code>def _attempt(obj, action, actor, msg): 
      actor.is_authenticated() 
      if isinstance(actor, LazyObject): 
          print type(actor) 
  </code></pre>
  
  <p>I'm passing a user, however the <code>if</code> condition is still true, actor is still a <code>LazyObject</code>. Why is this so?</p>