@task
@use_master
def fetch_promo_imgs(pk, promo_img_url, **kw):
 website = Website.objects.get(pk=pk)
 log.info(u'[Website:%s] Fetching promo img for website', website.name)
 try:
  response = _fetch_content(promo_img_url)
 except Exception as e:
  log.error((u'[Website:%s] Failed to fetch promo img for website: %s' % (website, e)))
  website.update(promo_img_hash='')
  return False
 log.info('[Website:%s] Promo img fetching done , saving ', website.name)
 save_promo_imgs(website, response.content)
 return True

@ task @ use_master def fetch_promo_imgs ( pk , promo_img_url , ** kw ) : website = Website . objects . get ( pk = pk ) log . info ( u'[Website:%s] Fetching promo img for website' , website . name ) try : response = _fetch_content ( promo_img_url ) except Exception as e : log . error ( ( u'[Website:%s] Failed to fetch promo img for website: %s' % ( website , e ) ) ) website . update ( promo_img_hash = '' ) return False log . info ( '[Website:%s] Promo img fetching done , saving ' , website . name ) save_promo_imgs ( website , response . content ) return True
downloads a promo image from the location passed to the task .