Is better to check None with:

    if profile_name is None: