@task
@write
def approve_rereview(theme):
 storage = LocalFileStorage()
 rereview = theme.rereviewqueuetheme_set.all()
 reupload = rereview[0]
 if (reupload.header_path != reupload.theme.header_path):
  create_persona_preview_images(src=reupload.header_path, full_dst=[reupload.theme.thumb_path, reupload.theme.icon_path], set_modified_on=[reupload.theme.addon])
  if (not reupload.theme.is_new()):
   copy_stored_file(reupload.theme.thumb_path, reupload.theme.preview_path, storage=storage)
  move_stored_file(reupload.header_path, reupload.theme.header_path, storage=storage)
 theme = reupload.theme
 footer_path = theme.footer_path
 if (reupload.footer_path != footer_path):
  if (not footer_path):
   dst_root = os.path.join(user_media_path('addons'), str(theme.addon.id))
   footer_path = os.path.join(dst_root, 'footer.png')
   theme.footer = 'footer.png'
   theme.save()
  move_stored_file(reupload.footer_path, footer_path, storage=storage)
 rereview.delete()
 theme.addon.increment_theme_version_number()

@ task @ write def approve_rereview ( theme ) : storage = LocalFileStorage ( ) rereview = theme . rereviewqueuetheme_set . all ( ) reupload = rereview [ 0 ] if ( reupload . header_path != reupload . theme . header_path ) : create_persona_preview_images ( src = reupload . header_path , full_dst = [ reupload . theme . thumb_path , reupload . theme . icon_path ] , set_modified_on = [ reupload . theme . addon ] ) if ( not reupload . theme . is_new ( ) ) : copy_stored_file ( reupload . theme . thumb_path , reupload . theme . preview_path , storage = storage ) move_stored_file ( reupload . header_path , reupload . theme . header_path , storage = storage ) theme = reupload . theme footer_path = theme . footer_path if ( reupload . footer_path != footer_path ) : if ( not footer_path ) : dst_root = os . path . join ( user_media_path ( 'addons' ) , str ( theme . addon . id ) ) footer_path = os . path . join ( dst_root , 'footer.png' ) theme . footer = 'footer.png' theme . save ( ) move_stored_file ( reupload . footer_path , footer_path , storage = storage ) rereview . delete ( ) theme . addon . increment_theme_version_number ( )
replace original theme with pending theme on filesystem .