Check is_authenticated rather than is_anonymous