def approve_files(files_with_review_type):
 for (file_, review_type) in files_with_review_type:
  version = file_.version
  addon = version.addon
  helper = ReviewHelper(request=None, addon=addon, version=file_.version)
  helper.set_data({'addon_files': [file_], 'comments': u'bulk approval'})
  if (review_type == 'full'):
   helper.handler.process_public()
   log.info(u'File %s (addon %s) approved', file_.pk, addon.pk)
  else:
   log.info(u'File %s (addon %s) not approved: addon status: %s, file status: %s', file_.pk, addon.pk, addon.status, file_.status)

def approve_files ( files_with_review_type ) : for ( file_ , review_type ) in files_with_review_type : version = file_ . version addon = version . addon helper = ReviewHelper ( request = None , addon = addon , version = file_ . version ) helper . set_data ( { 'addon_files' : [ file_ ] , 'comments' : u'bulk approval' } ) if ( review_type == 'full' ) : helper . handler . process_public ( ) log . info ( u'File %s (addon %s) approved' , file_ . pk , addon . pk ) else : log . info ( u'File %s (addon %s) not approved: addon status: %s, file status: %s' , file_ . pk , addon . pk , addon . status , file_ . status )
approve the files waiting for review .