#NEWLINE# @ require_POST #NEWLINE# @ require_can_edit_data #NEWLINE# def excel_commit( request , domain ) : #NEWLINE# #INDENT# '\n    Step three of three.\n\n    This page is submitted with the list of column to\n    case property mappings for this upload.\n\n    The config variable is an ImporterConfig object that\n    has everything gathered from previous steps, with the\n    addition of all the field data. See that class for\n    more information.\n    ' #NEWLINE# config = importer_util . ImporterConfig . from_request ( request ) #NEWLINE# excel_id = request . session . get ( EXCEL_SESSION_ID ) #NEWLINE# excel_ref = DownloadBase . get ( excel_id ) #NEWLINE# try : #NEWLINE# #INDENT# importer_util . get_spreadsheet ( excel_ref , config . named_columns ) #NEWLINE# #UNINDENT# except ImporterError as e : #NEWLINE# #INDENT# return render_error ( request , domain , _get_importer_error_message ( e ) ) #NEWLINE# #UNINDENT# download = DownloadBase ( ) #NEWLINE# download . set_task ( bulk_import_async . delay ( download . download_id , config , domain , excel_id ) ) #NEWLINE# try : #NEWLINE# #INDENT# del request . session [ EXCEL_SESSION_ID ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# return render ( request , 'importer/excel_commit.html' , { #NEWLINE# #INDENT# 'download_id' : download . download_id , #NEWLINE# 'template' : 'importer/partials/import_status.html' , #NEWLINE# 'domain' : domain , #NEWLINE# 'report' : { #NEWLINE# #INDENT# 'name' : 'Import: Completed' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'slug' : base . ImportCases . slug , #NEWLINE# #UNINDENT# } )