AttributeError: ‘bool’ object has no attribute ‘_sa_instance_state’ when checking if something exists in the DB

Solution
favorited_park = Park.query.filter_by(park_code=park_code) is not None
Park.query.filter_by(park_code=park_code)
favorited_park =  is not None
1 is not None  # True
"a string" is not None  # True
object() is not None  # True
favorited_park = True
if favorited_park:
user.parks.append(favorited_park)
favorited_park = Park.query.filter_by(park_code=park_code).one_or_none()