@cronjobs.register
def process_exit_surveys():
 _process_exit_survey_results()
 if settings.STAGE:
  return
 startdate = (date.today() - timedelta(days=2))
 enddate = (date.today() - timedelta(days=1))
 for survey in SURVEYS.keys():
  if ('email_collection_survey_id' not in SURVEYS[survey]):
   continue
  emails = get_email_addresses(survey, startdate, enddate)
  for email in emails:
   add_email_to_campaign(survey, email)
  statsd.gauge('survey.{0}'.format(survey), len(emails))

@ cronjobs . register def process_exit_surveys ( ) : _process_exit_survey_results ( ) if settings . STAGE : return startdate = ( date . today ( ) - timedelta ( days = 2 ) ) enddate = ( date . today ( ) - timedelta ( days = 1 ) ) for survey in SURVEYS . keys ( ) : if ( 'email_collection_survey_id' not in SURVEYS [ survey ] ) : continue emails = get_email_addresses ( survey , startdate , enddate ) for email in emails : add_email_to_campaign ( survey , email ) statsd . gauge ( 'survey.{0}' . format ( survey ) , len ( emails ) )
exit survey handling .