(self, all_to_remove, checked_case_id, xform_id)
Remove all cases marked for removal. Traverse child cases and try to purge those too.
Remove all cases marked for removal. Traverse child cases and try to purge those too.
Remove all cases marked for removal . Traverse child cases and try to purge those too .
def _remove_cases_purge_indices(self, all_to_remove, checked_case_id, xform_id):
        """Remove all cases marked for removal. Traverse child cases and try to purge those too."""

        _get_logger().debug("cases to to_remove: {}".format(all_to_remove))
        for to_remove in all_to_remove:
            indices = self.index_tree.indices.get(to_remove, {})
            self._remove_case(to_remove, all_to_remove, checked_case_id, xform_id)
            for referenced_case in indices.values():
                is_dependent_case = referenced_case in self.dependent_case_ids_on_phone
                already_primed_for_removal = referenced_case in all_to_remove
                if is_dependent_case and not already_primed_for_removal and referenced_case != checked_case_id:
                    self.purge(referenced_case, xform_id)
def _remove_cases_purge_indices ( self , all_to_remove , checked_case_id , xform_id ) : _get_logger ( ) . debug ( "cases to to_remove: {}" . format ( all_to_remove ) ) for to_remove in all_to_remove : indices = self . index_tree . indices . get ( to_remove , { } ) self . _remove_case ( to_remove , all_to_remove , checked_case_id , xform_id ) for referenced_case in indices . values ( ) : is_dependent_case = referenced_case in self . dependent_case_ids_on_phone already_primed_for_removal = referenced_case in all_to_remove if is_dependent_case and not already_primed_for_removal and referenced_case != checked_case_id : self . purge ( referenced_case , xform_id )