def approve_rereview(theme): """Replace original theme with pending theme on filesystem.""" # If reuploaded theme, replace old theme design. storage = LocalFileStorage() rereview = theme.rereviewqueuetheme_set.all() reupload = rereview[0] if reupload.header_path != reupload.theme.header_path: move_stored_file(reupload.header_path, reupload.theme.header_path, storage=storage) if reupload.footer_path != reupload.theme.footer_path: move_stored_file(reupload.footer_path, reupload.theme.footer_path, storage=storage) create_persona_preview_images( src=reupload.theme.header_path, full_dst=[ reupload.theme.header_path.replace('header', 'preview'), reupload.theme.header_path.replace('header', 'icon') ], set_modified_on=[reupload.theme.addon]) rereview.delete() theme.addon.increment_version()
def approve_rereview(theme): """Replace original theme with pending theme on filesystem.""" # If reuploaded theme, replace old theme design. 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(): # Legacy themes also need a preview_large.jpg. # Modern themes use preview.png for both thumb and preview so there # is no problem there. 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) if reupload.footer_path != reupload.theme.footer_path: move_stored_file(reupload.footer_path, reupload.theme.footer_path, storage=storage) rereview.delete() theme.addon.increment_version()
def approve_rereview(theme): """Replace original theme with pending theme on filesystem.""" # If reuploaded theme, replace old theme design. 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(): # Legacy themes also need a preview_large.jpg. # Modern themes use preview.png for both thumb and preview so there # is no problem there. 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) if reupload.footer_path != reupload.theme.footer_path: move_stored_file( reupload.footer_path, reupload.theme.footer_path, storage=storage) rereview.delete() theme.addon.increment_version()
def approve_rereview(theme): """Replace original theme with pending theme on filesystem.""" # If reuploaded theme, replace old theme design. storage = LocalFileStorage() rereview = theme.rereviewqueuetheme_set.all() reupload = rereview[0] move_stored_file( reupload.header_path, reupload.theme.header_path, storage=storage) move_stored_file( reupload.footer_path, reupload.theme.footer_path, storage=storage) create_persona_preview_images( src=reupload.theme.header_path, full_dst=[ reupload.theme.header_path.replace('header', 'preview'), reupload.theme.header_path.replace('header', 'icon')], set_modified_on=[reupload.theme.addon]) rereview.delete()