Use request.user.is_anonymous versus doing type check.