[ckan-dev] Adding a resource using a background task

Pabitra Dash pkdash_reena at hotmail.com
Mon Sep 9 14:24:29 UTC 2013


Hello Adria,

I found a workaround to avoid this error by having a key of "message" with an associated value in the context object that I am passing to the resource_create action.
 
Thanks,
Pabitra

 
> Date: Mon, 9 Sep 2013 10:23:38 +0100
> From: adria.mercader at okfn.org
> To: ckan-dev at lists.okfn.org
> Subject: Re: [ckan-dev] Adding a resource using a background task
> 
> Hi Pabitra,
> 
> Although I vaguely remember finding this error a while ago and that
> there was a workaround for fixing it, I think you will be better of if
> instead of calling the action directly from your background task (ie
> with get_action) you call your CKAN instance api (ie POST
> http://ckaninstance.com/api/action/resource_create). At least that's
> the way the celery processes I'm aware of work. See eg ckanext-qa and
> ckanext-archiver:
> 
> https://github.com/okfn/ckanext-qa/blob/master/ckanext/qa/tasks.py
> https://github.com/okfn/ckanext-archiver/blob/master/ckanext/archiver/tasks.py
> 
> 
> Adrià
> 
> On 6 September 2013 00:22, Pabitra Dash <pkdash_reena at hotmail.com> wrote:
> > Hi  all,
> >
> > I am trying to add a resource (a file) using the action method
> > "resource_create" in a celery based background task. I am getting the
> > following error:
> >
> > TypeError: No object (name:translator) has not been registered for this
> > thread.
> >
> > Not sure how to resolve this error. Any help would be appreciated.
> >
> > Pabitra
> >
> >
> >
> >
> > _______________________________________________
> > ckan-dev mailing list
> > ckan-dev at lists.okfn.org
> > http://lists.okfn.org/mailman/listinfo/ckan-dev
> > Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
> >
> 
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130909/0f55fed8/attachment-0001.html>


More information about the ckan-dev mailing list