(case_ids, domain, user, device_id, case_db=None)
return submit_case_blocks(
        case_blocks,
        domain,
        username,
        user_id,
        device_id=device_id,
        case_db=case_db,
    )[0].form_id
Close cases by submitting a close forms.

    Accepts submitting user as a user object or a fake system user string.

    See `device_id` parameter documentation at
    `corehq.apps.hqcase.utils.submit_case_blocks`.

    Returns the form id of the closing form.
Close cases by submitting a close forms.
Close cases by submitting a close forms .
def close_cases(case_ids, domain, user, device_id, case_db=None):
    """
    Close cases by submitting a close forms.

    Accepts submitting user as a user object or a fake system user string.

    See `device_id` parameter documentation at
    `corehq.apps.hqcase.utils.submit_case_blocks`.

    Returns the form id of the closing form.
    """
    if hasattr(user, '_id'):
        user_id = user._id
        username = user.username
    else:
        user_id = user
        username = user

    case_blocks = [ElementTree.tostring(CaseBlock.deprecated_init(
        create=False,
        case_id=case_id,
        close=True,
    ).as_xml(), encoding='utf-8').decode('utf-8') for case_id in case_ids]

    return submit_case_blocks(
        case_blocks,
        domain,
        username,
        user_id,
        device_id=device_id,
        case_db=case_db,
    )[0].form_id
def close_cases ( case_ids , domain , user , device_id , case_db = None ) : if hasattr ( user , '_id' ) : user_id = user . _id username = user . username else : user_id = user username = user case_blocks = [ ElementTree . tostring ( CaseBlock . deprecated_init ( create = False , case_id = case_id , close = True , ) . as_xml ( ) , encoding = 'utf-8' ) . decode ( 'utf-8' ) for case_id in case_ids ] return submit_case_blocks ( case_blocks , domain , username , user_id , device_id = device_id , case_db = case_db , ) [ 0 ] . form_id