title: How to call is_authenticated in Flask-login
body: <p>I'm using flask-login with the following User class. At first I didn't override the <code>is_authenticated()</code> method but I thought it might fix my problem (it didn't).</p>
  
  <p>I ran my code on 3 different computers. On one of them I have to call the <code>is_authenticated()</code> method as a regular method (with the <code>()</code>) and on the other 2 I have to use is_authenticated as a boolean (without the <code>()</code>). </p>
  
  <p>In all the computers the interpreter is set to python2.7.<br>
  What am I missing?</p>
  
  <pre><code>class User(UserMixin):
      """
      Defines each user.
      """
      def __init__(self, user, pwd):
          self.username = user
          self.password = pwd
  
      def get_id(self):
          return self.username
  
      def is_authenticated(self):
          return True
  </code></pre>
  
  <p>Here's I call the method:</p>
  
  <pre><code>@app.before_request
  def before_request():
      g.user = flask.ext.login.current_user
      g.username = g.user.get_id()
  
  
  @app.route('/', methods=['GET', 'POST'])
  @flask.ext.login.login_required
  def index():
      if g.user is None or not g.user.is_authenticated(): // or g.user.is_authenticated
          return redirect('login')
      return render_template('main.html', user=g.username)
  </code></pre>