def get_user_is_authenticated(user):
if callable(user.is_authenticated):<EOL><INDENT>return user.is_authenticated()<EOL><DEDENT>else:<EOL><INDENT>return user.is_authenticated<EOL><DEDENT>
Check if the user is authenticated.

    This is a compatibility function needed to support both Django 1.x and 2.x;
    Django 2.x turns the function into a proper boolean so function calls will
    fail.