def auto_sign_file(file_, is_beta=False):
 addon = file_.version.addon
 if file_.is_experiment:
  amo.log(amo.LOG.EXPERIMENT_SIGNED, file_)
  sign_file(file_, settings.SIGNING_SERVER)
 elif is_beta:
  if file_.validation.passed_auto_validation:
   amo.log(amo.LOG.BETA_SIGNED_VALIDATION_PASSED, file_)
  else:
   amo.log(amo.LOG.BETA_SIGNED_VALIDATION_FAILED, file_)
  sign_file(file_, settings.SIGNING_SERVER)
 elif (file_.version.channel == amo.RELEASE_CHANNEL_UNLISTED):
  helper = ReviewHelper(request=None, addon=addon, version=file_.version)
  helper.set_data({'addon_files': [file_], 'comments': 'automatic validation'})
  helper.handler.process_public()
  if file_.validation.passed_auto_validation:
   amo.log(amo.LOG.UNLISTED_SIGNED_VALIDATION_PASSED, file_)
  else:
   amo.log(amo.LOG.UNLISTED_SIGNED_VALIDATION_FAILED, file_)

def auto_sign_file ( file_ , is_beta = False ) : addon = file_ . version . addon if file_ . is_experiment : amo . log ( amo . LOG . EXPERIMENT_SIGNED , file_ ) sign_file ( file_ , settings . SIGNING_SERVER ) elif is_beta : if file_ . validation . passed_auto_validation : amo . log ( amo . LOG . BETA_SIGNED_VALIDATION_PASSED , file_ ) else : amo . log ( amo . LOG . BETA_SIGNED_VALIDATION_FAILED , file_ ) sign_file ( file_ , settings . SIGNING_SERVER ) elif ( file_ . version . channel == amo . RELEASE_CHANNEL_UNLISTED ) : helper = ReviewHelper ( request = None , addon = addon , version = file_ . version ) helper . set_data ( { 'addon_files' : [ file_ ] , 'comments' : 'automatic validation' } ) helper . handler . process_public ( ) if file_ . validation . passed_auto_validation : amo . log ( amo . LOG . UNLISTED_SIGNED_VALIDATION_PASSED , file_ ) else : amo . log ( amo . LOG . UNLISTED_SIGNED_VALIDATION_FAILED , file_ )
if the file should be automatically reviewed and signed .