(domain)
return len(user_ids)
Get total number of users who've ever submitted a form in a domain.
Get total number of users who've ever submitted a form in a domain.
Get total number of users who ve ever submitted a form in a domain .
def total_distinct_users(domain):
    """
    Get total number of users who've ever submitted a form in a domain.
    """
    query = FormES().domain(domain).user_aggregation()
    terms = {
        user_id for user_id in query.run().aggregations.user.keys
        if user_id not in WEIRD_USER_IDS
    }
    user_ids = terms.intersection(set(CouchUser.ids_by_domain(domain)))
    return len(user_ids)
def total_distinct_users ( domain ) : query = FormES ( ) . domain ( domain ) . user_aggregation ( ) terms = { user_id for user_id in query . run ( ) . aggregations . user . keys if user_id not in WEIRD_USER_IDS } user_ids = terms . intersection ( set ( CouchUser . ids_by_domain ( domain ) ) ) return len ( user_ids )