diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_importCategoryFile.py b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_importCategoryFile.py index d423c325146423fa4cb4b2ff0d703392c5290f60..ef5888f9076ae647bd902e3c1342216f48a161d2 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_importCategoryFile.py +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_importCategoryFile.py @@ -57,7 +57,8 @@ category_list_spreadsheet_dict = context.Base_getCategoriesSpreadSheetMapping( if detailed_report_result: REQUEST.other['portal_status_message'] = translateString('Spreasheet contains errors') REQUEST.other['category_import_report'] = detailed_report_result - REQUEST.RESPONSE.write(portal_categories.CategoryTool_viewImportReport().encode('utf-8')) + REQUEST.RESPONSE.setBody(portal_categories.CategoryTool_viewImportReport().encode('utf-8'), lock=True) + REQUEST.RESPONSE.setStatus(200, 'OK', lock=True) raise Exception('Spreadsheet contains errors') for base_category, category_list in category_list_spreadsheet_dict.iteritems(): @@ -209,8 +210,9 @@ if detailed_report: REQUEST.other['category_import_report'] = detailed_report_result result = portal_categories.CategoryTool_viewImportReport().encode('utf-8') if simulation_mode: - REQUEST.RESPONSE.write(result) - raise Exception('Dry run') + REQUEST.RESPONSE.setBody(result, lock=True) + REQUEST.RESPONSE.setStatus(200, 'OK', lock=True) + raise Exception('Dry run') return result portal_categories.Base_redirect( keep_items={