def save_promo_imgs(obj, img_content):
 tmp_dst = os.path.join(settings.TMP_PATH, 'promo_imgs', uuid.uuid4().hex)
 with private_storage.open(tmp_dst, 'wb') as fd:
  fd.write(img_content)
 dirname = obj.get_promo_img_dir()
 destination = os.path.join(dirname, ('%s' % obj.pk))
 remove_promo_imgs(destination)
 resize_promo_imgs(tmp_dst, destination, mkt.PROMO_IMG_SIZES, set_modified_on=[obj])

def save_promo_imgs ( obj , img_content ) : tmp_dst = os . path . join ( settings . TMP_PATH , 'promo_imgs' , uuid . uuid4 ( ) . hex ) with private_storage . open ( tmp_dst , 'wb' ) as fd : fd . write ( img_content ) dirname = obj . get_promo_img_dir ( ) destination = os . path . join ( dirname , ( '%s' % obj . pk ) ) remove_promo_imgs ( destination ) resize_promo_imgs ( tmp_dst , destination , mkt . PROMO_IMG_SIZES , set_modified_on = [ obj ] )
saves the promo image for obj to its final destination .