Exemple #1
0
def _create_domain(name, cc_enabled, cc_use_fixtures, cc_case_type, cc_case_owner_id, use_location_as_owner):
    with drop_connected_signals(commcare_domain_post_save):
        domain = Domain(
            _id=uuid.uuid4().hex,
            name=name,
            is_active=True,
            date_created=datetime.utcnow(),
        )
        domain.call_center_config.enabled = cc_enabled
        domain.call_center_config.use_fixtures = cc_use_fixtures
        domain.call_center_config.case_type = cc_case_type
        domain.call_center_config.case_owner_id = cc_case_owner_id
        domain.call_center_config.use_user_location_as_owner = use_location_as_owner

        send_to_elasticsearch(
            'domains',
            doc=domain.to_json(),
        )
Exemple #2
0
def _create_domain(name, cc_enabled, cc_use_fixtures, cc_case_type, cc_case_owner_id, use_location_as_owner):
    with drop_connected_signals(commcare_domain_post_save):
        domain = Domain(
            _id=uuid.uuid4().hex,
            name=name,
            is_active=True,
            date_created=datetime.utcnow(),
        )
        domain.call_center_config.enabled = cc_enabled
        domain.call_center_config.use_fixtures = cc_use_fixtures
        domain.call_center_config.case_type = cc_case_type
        domain.call_center_config.case_owner_id = cc_case_owner_id
        domain.call_center_config.use_user_location_as_owner = use_location_as_owner

        send_to_elasticsearch(
            'domains',
            doc=domain.to_json(),
        )