Commit 7c0fe44d authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

erp5_core: fix

parent 0b70d293
from transaction import doom
from zExceptions import Success
from Products.ERP5Type.Message import translateString from Products.ERP5Type.Message import translateString
from Products.ERP5Type.Document import newTempBase from Products.ERP5Type.Document import newTempBase
...@@ -57,8 +59,9 @@ category_list_spreadsheet_dict = context.Base_getCategoriesSpreadSheetMapping( ...@@ -57,8 +59,9 @@ category_list_spreadsheet_dict = context.Base_getCategoriesSpreadSheetMapping(
if detailed_report_result: if detailed_report_result:
REQUEST.other['portal_status_message'] = translateString('Spreasheet contains errors') REQUEST.other['portal_status_message'] = translateString('Spreasheet contains errors')
REQUEST.other['category_import_report'] = detailed_report_result REQUEST.other['category_import_report'] = detailed_report_result
REQUEST.RESPONSE.write(portal_categories.CategoryTool_viewImportReport().encode('utf-8')) # Spreadsheet contains errors
raise Exception('Spreadsheet contains errors') doom()
raise Success(portal_categories.CategoryTool_viewImportReport().encode('utf-8'))
for base_category, category_list in category_list_spreadsheet_dict.iteritems(): for base_category, category_list in category_list_spreadsheet_dict.iteritems():
total_category_counter += len(category_list) total_category_counter += len(category_list)
...@@ -211,8 +214,9 @@ if detailed_report: ...@@ -211,8 +214,9 @@ if detailed_report:
REQUEST.other['category_import_report'] = detailed_report_result REQUEST.other['category_import_report'] = detailed_report_result
result = portal_categories.CategoryTool_viewImportReport().encode('utf-8') result = portal_categories.CategoryTool_viewImportReport().encode('utf-8')
if simulation_mode: if simulation_mode:
REQUEST.RESPONSE.write(result) # Dry run
raise Exception('Dry run') doom()
raise Success(result)
return result return result
portal_categories.Base_redirect( portal_categories.Base_redirect(
keep_items={ keep_items={
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment