@require_POST
@require_can_edit_data
def excel_commit(request, domain):
    """
    Step three of three.

    This page is submitted with the list of column to
    case property mappings for this upload.

    The config variable is an ImporterConfig object that
    has everything gathered from previous steps, with the
    addition of all the field data. See that class for
    more information.
    """
    config = importer_util.ImporterConfig.from_request(request)

    excel_id = request.session.get(EXCEL_SESSION_ID)

    excel_ref = DownloadBase.get(excel_id)
    try:
        importer_util.get_spreadsheet(excel_ref, config.named_columns)
    except ImporterError as e:
        return render_error(request, domain, _get_importer_error_message(e))

    download = DownloadBase()
    download.set_task(bulk_import_async.delay(
        download.download_id,
        config,
        domain,
        excel_id,
    ))

    try:
        del request.session[EXCEL_SESSION_ID]
    except __HOLE__:
        pass

    return render(
        request,
        "importer/excel_commit.html", {
            'download_id': download.download_id,
            'template': 'importer/partials/import_status.html',
            'domain': domain,
            'report': {
                'name': 'Import: Completed'
            },
            'slug': base.ImportCases.slug
        }
    )
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/importer/views.py/excel_commit