you should use submit_case_blocks to update the case. see an example here: https://github.com/dimagi/commcare-hq/blob/master/corehq/apps/hqcase/utils.py#L175