@register.filter(name='bool_to_icon')
def bool_to_icon(value):
    try:
        if type(value) is bool:
            style = 'glyphicon-ok green' if value else 'glyphicon-remove red'
            return '<span class="glyphicon glyphicon-2x %s" aria-hidden="true"></span>' % (style, )
        else:
            return 'N/A'
    except:
        return 'N/A'
dataset/ETHPy150Open emccode/heliosburn/heliosburn/django/hbproject/webui/templatetags/tags.py/bool_to_icon/original