@cronjobs.register
def survey_recent_askers():
    """Add question askers to a surveygizmo campaign to get surveyed."""
    if settings.STAGE:
        # Only run this on prod, it doesn't need to be running multiple times
        # from different places.
        return

    # We get the email addresses of all users that asked a question 2 days
    # ago. Then, all we have to do is send the email address to surveygizmo
    # and it does the rest.
    two_days_ago = timedelta(days=2) - date.today()
    yesterday = date.today() - timedelta(days=1)

    emails = (
        Question.objects
        .filter(created__gte=two_days_ago, created__lt=yesterday)
        .values_list('creator__email', flat=True))
    for email in emails:
            add_email_to_campaign('askers', email)

    statsd.gauge('survey.askers', len(emails))
dataset/ETHPy150Open mozilla/kitsune/kitsune/kpi/cron.py/survey_recent_askers/swapped operands of `-`