(request, domain)
return json_response(context)
Polls celery to see how the export download task is going.
    :return: final response: {
        'success': True,
        'dropbox_url': '<url>',
        'download_url: '<url>',
        <task info>
    }
Polls celery to see how the export download task is going.
    :return: final response: {
        'success': True,
        'dropbox_url': '<url>',
        'download_url: '<url>',
        <task info>
    }
Polls celery to see how the export download task is going . : return : final response : { success : True dropbox_url : <url > download_url : <url > <task info > }
def poll_custom_export_download(request, domain):
    """Polls celery to see how the export download task is going.
    :return: final response: {
        'success': True,
        'dropbox_url': '<url>',
        'download_url: '<url>',
        <task info>
    }
    """
    form_or_case = request.GET.get('form_or_case')
    permissions = ExportsPermissionsManager(form_or_case, domain, request.couch_user)
    permissions.access_download_export_or_404()
    download_id = request.GET.get('download_id')
    try:
        context = get_download_context(download_id)
    except TaskFailedError as e:
        if e.exception_name == 'XlsLengthException':
            return JsonResponse({
                'error': _(
                    'This file has more than 256 columns, which is not supported by xls. '
                    'Please change the output type to csv or xlsx to export this file.')
            })
        else:
            notify_exception(
                request, "Export download failed",
                details={'download_id': download_id, 'errors': e.errors,
                         'exception_name': e.exception_name})

            return JsonResponse({
                'error': _("Download task failed to start."),
            })

    if context.get('is_ready', False):
        context.update({
            'dropbox_url': reverse('dropbox_upload', args=(download_id,)),
            'download_url': "{}?get_file".format(
                reverse('retrieve_download', args=(download_id,))
            ),
        })
    context['is_poll_successful'] = True
    return json_response(context)
def poll_custom_export_download ( request , domain ) : form_or_case = request . GET . get ( 'form_or_case' ) permissions = ExportsPermissionsManager ( form_or_case , domain , request . couch_user ) permissions . access_download_export_or_404 ( ) download_id = request . GET . get ( 'download_id' ) try : context = get_download_context ( download_id ) except TaskFailedError as e : if e . exception_name == 'XlsLengthException' : return JsonResponse ( { 'error' : _ ( 'This file has more than 256 columns, which is not supported by xls. ' 'Please change the output type to csv or xlsx to export this file.' ) } ) else : notify_exception ( request , "Export download failed" , details = { 'download_id' : download_id , 'errors' : e . errors , 'exception_name' : e . exception_name } ) return JsonResponse ( { 'error' : _ ( "Download task failed to start." ) , } ) if context . get ( 'is_ready' , False ) : context . update ( { 'dropbox_url' : reverse ( 'dropbox_upload' , args = ( download_id , ) ) , 'download_url' : "{}?get_file" . format ( reverse ( 'retrieve_download' , args = ( download_id , ) ) ) , } ) context [ 'is_poll_successful' ] = True return json_response ( context )