Exemplo n.º 1
0
def get_case_owner_filters(domains):
    mobile_user_ids = list(get_user_ids(True, domains))
    group_query = GroupES()
    if domains:
        group_query = group_query.domain(domains)
    group_ids = group_query.get_ids()
    return filters.term('owner_id', mobile_user_ids + group_ids)
Exemplo n.º 2
0
def get_case_owner_filters(domains):
    mobile_user_ids = list(get_user_ids(True, domains))
    group_query = GroupES()
    if domains:
        group_query = group_query.domain(domains)
    group_ids = group_query.get_ids()
    return filters.term('owner_id', mobile_user_ids + group_ids)
Exemplo n.º 3
0
 def filter_context(self):
     return {
         "initial_value":
         self.get_value(self.request, self.domain),
         "groups": [{
             '_id': '',
             'name': ''
         }] +
         GroupES().domain(self.domain).source(['_id', 'name']).run().hits,
     }
Exemplo n.º 4
0
 def get_users_by_group_filter(self, group_ids):
     return GroupES().domain(self.domain).group_ids(group_ids).values_list(
         "users", flat=True)