(username=None, domain=None)
return {by_name[name].slug: True for name in enabled if name in by_name}
Loads all toggles into a dictionary for use in JS

    (only enabled toggles are included)
Loads all toggles into a dictionary for use in JS
Loads all toggles into a dictionary for use in JS
def toggles_dict(username=None, domain=None):
    """
    Loads all toggles into a dictionary for use in JS

    (only enabled toggles are included)
    """
    by_name = all_toggles_by_name()
    enabled = set()
    if username:
        enabled |= toggles_enabled_for_user(username)
    if domain:
        enabled |= toggles_enabled_for_domain(domain)
    return {by_name[name].slug: True for name in enabled if name in by_name}
def toggles_dict ( username = None , domain = None ) : by_name = all_toggles_by_name ( ) enabled = set ( ) if username : enabled |= toggles_enabled_for_user ( username ) if domain : enabled |= toggles_enabled_for_domain ( domain ) return { by_name [ name ] . slug : True for name in enabled if name in by_name }