def has_valid_attr(settings, attr_name):
    """
        Checks if settings has the attribute [attr_name] and it's not an empty string.
    """
    attr = getattr(settings, attr_name, None)
    return attr is not None and attr
