def _compare_users(domain, doc_type): include_web_users = doc_type == 'WebUser' if not include_web_users and 'Deleted' in doc_type: # deleted users = all users - non-deleted users all_mobile_user_ids = set( get_doc_ids_in_domain_by_class(domain, CommCareUser)) non_deleted_mobile_user_ids = get_mobile_user_ids(domain) couch_count = all_mobile_user_ids - non_deleted_mobile_user_ids else: couch_count = set( get_all_user_ids_by_domain( domain, include_web_users=include_web_users, include_mobile_users=not include_web_users)) return _get_diffs(couch_count, get_es_user_ids(domain, doc_type))
def _compare_users(domain, doc_type, startdate, enddate): if startdate or enddate: raise CommandError("Date filtering not supported for users") include_web_users = doc_type == 'WebUser' if not include_web_users and 'Deleted' in doc_type: # deleted users = all users - non-deleted users all_mobile_user_ids = set( get_doc_ids_in_domain_by_class(domain, CommCareUser)) non_deleted_mobile_user_ids = get_mobile_user_ids(domain) couch_count = all_mobile_user_ids - non_deleted_mobile_user_ids else: couch_count = set( get_all_user_ids_by_domain( domain, include_web_users=include_web_users, include_mobile_users=not include_web_users)) return _get_diffs(couch_count, get_es_user_ids(domain, doc_type))
def _compare_users(domain, doc_type, startdate, enddate): if startdate or enddate: raise CommandError("Date filtering not supported for users") include_web_users = doc_type == 'WebUser' if not include_web_users and 'Deleted' in doc_type: # deleted users = all users - non-deleted users all_mobile_user_ids = set(get_doc_ids_in_domain_by_class(domain, CommCareUser)) non_deleted_mobile_user_ids = get_mobile_user_ids(domain) couch_count = all_mobile_user_ids - non_deleted_mobile_user_ids else: couch_count = set(get_all_user_ids_by_domain( domain, include_web_users=include_web_users, include_mobile_users=not include_web_users) ) return _get_diffs( couch_count, get_es_user_ids(domain, doc_type) )