(context, request, selected_domain=None)
return mark_safe(  # nosec: render_to_string should have already handled escaping
        render_to_string('hqwebapp/includes/domain_list_dropdown.html', context, request)
    )
Generate pulldown menu for domains.
    Cache the entire string alongside the couch_user's doc_id that can get invalidated when
    the user doc updates via save.
Generate pulldown menu for domains.
    Cache the entire string alongside the couch_user's doc_id that can get invalidated when
    the user doc updates via save.
Generate pulldown menu for domains . Cache the entire string alongside the couch_user s doc_id that can get invalidated when the user doc updates via save .
def domains_for_user(context, request, selected_domain=None):
    """
    Generate pulldown menu for domains.
    Cache the entire string alongside the couch_user's doc_id that can get invalidated when
    the user doc updates via save.
    """

    from corehq.apps.domain.views.base import get_domain_links_for_dropdown, get_enterprise_links_for_dropdown
    domain_links = get_domain_links_for_dropdown(request.couch_user)

    # Enterprise permissions projects aren't in the dropdown, but show a hint they exist
    show_all_projects_link = bool(get_enterprise_links_for_dropdown(request.couch_user))

    # Too many domains and they won't all fit in the dropdown
    dropdown_limit = 20
    if len(domain_links) > dropdown_limit:
        show_all_projects_link = True
        domain_links = domain_links[:dropdown_limit]

    context = {
        'domain_links': domain_links,
        'show_all_projects_link': show_all_projects_link,
    }
    return mark_safe(  # nosec: render_to_string should have already handled escaping
        render_to_string('hqwebapp/includes/domain_list_dropdown.html', context, request)
    )
def domains_for_user ( context , request , selected_domain = None ) : from corehq . apps . domain . views . base import get_domain_links_for_dropdown , get_enterprise_links_for_dropdown domain_links = get_domain_links_for_dropdown ( request . couch_user ) # Enterprise permissions projects aren't in the dropdown, but show a hint they exist show_all_projects_link = bool ( get_enterprise_links_for_dropdown ( request . couch_user ) ) # Too many domains and they won't all fit in the dropdown dropdown_limit = 20 if len ( domain_links ) > dropdown_limit : show_all_projects_link = True domain_links = domain_links [ : dropdown_limit ] context = { 'domain_links' : domain_links , 'show_all_projects_link' : show_all_projects_link , } return mark_safe ( # nosec: render_to_string should have already handled escaping render_to_string ( 'hqwebapp/includes/domain_list_dropdown.html' , context , request ) )