title: AttributeError: 'NoneType' object has no attribute 'is_active'
body: <p>I'm trying to set up a front-end user authentication check with Parsley.js and Django.<br>
  This is my view</p>
  
  <pre><code>@requires_csrf_token
  def password_check(request):
      email = request.POST.get('email')
      password = request.POST.get('password1')
      user = authenticate(email=email, password=password)
  
      if request.is_ajax():
          if user.is_active:
              res = "These password and e-mail are ok."
              ajax_vars_login = {'response': res, 'email': email, 'password': password}
              json_data_login = json.dumps(ajax_vars_login)
          else:
              res = "The e-mail or the password field aren't correct."
              ajax_vars_login = {'response': res, 'email': email, 'password': password}
              json_data_login = json.dumps(ajax_vars_login)
  
          return HttpResponse(json_data_login, content_type='application/json')
  </code></pre>
  
  <p>The validator</p>
  
  <pre><code>Parsley.addAsyncValidator(
    'emailPwCombination', function (xhr) {
         var password = $('#password').parsley();
         var email = $('#email').parsley();
         var response = xhr.responseText;
         var jsonResponse = JSON.parse(response);
         var jsonResponseText = jsonResponse["response"];
  
         if(jsonResponseText == 'The password and e-mail are ok.')
             return true;
         if(jsonResponseText == '404')
             return false;
    }, '/password_check/'
  );
  </code></pre>
  
  <p>But when the "password_check" function is called I get this error:<br>
  <strong>AttributeError at /password_check/<br>
  'NoneType' object has no attribute 'is_active'</strong></p>
  
  <p>I've tried to put a <em>print</em> after "request.is_ajax()" to test the values, and it sometimes catches the e-mail and sometimes the password, but never the two together.</p>
  
  <p>How could I fix that?</p>