def save_processed_models(self, case_db, xforms, case_stock_result):
        instance = xforms[0]
        try:
            with unfinished_submission(instance) as unfinished_submission_stub:
                try:
                    self.interface.save_processed_models(
                        xforms, case_stock_result.case_models,
                        case_stock_result.stock_result)
                except PostSaveError:
                    # mark the stub as saved if there's a post save error
                    # but re-raise the error so that the re-processing queue picks it up
                    unfinished_submission_stub.submission_saved()
                    raise
                else:
                    unfinished_submission_stub.submission_saved()

                self.do_post_save_actions(case_db, xforms, case_stock_result)
        except PostSaveError:
            return "Error performing post save operations"
    def save_processed_models(self, case_db, xforms, case_stock_result):
        instance = xforms[0]
        try:
            with unfinished_submission(instance) as unfinished_submission_stub:
                try:
                    self.interface.save_processed_models(
                        xforms,
                        case_stock_result.case_models,
                        case_stock_result.stock_result
                    )
                except PostSaveError:
                    # mark the stub as saved if there's a post save error
                    # but re-raise the error so that the re-processing queue picks it up
                    unfinished_submission_stub.submission_saved()
                    raise
                else:
                    unfinished_submission_stub.submission_saved()

                self.do_post_save_actions(case_db, xforms, case_stock_result)
        except PostSaveError:
            return "Error performing post save operations"