

@cronjobs.register
def update_l10n_contributor_metrics(day=None):
    'Update the number of active contributors for each locale/product.\n\n    An active contributor is defined as a user that created or reviewed a\n    revision in the previous calendar month.\n    '
    if (day is None):
        day = date.today()
    first_of_month = date(day.year, day.month, 1)
    if (day.month == 1):
        previous_first_of_month = date((day.year - 1), 12, 1)
    else:
        previous_first_of_month = date(day.year, (day.month - 1), 1)
    for locale in settings.SUMO_LANGUAGES:
        for product in ([None] + list(Product.objects.filter(visible=True))):
            num = num_active_contributors(from_date=previous_first_of_month, to_date=first_of_month, locale=locale, product=product)
            WikiMetric.objects.create(code=L10N_ACTIVE_CONTRIBUTORS_CODE, locale=previous_first_of_month, product=product, date=previous_first_of_month, value=num)

dataset/ETHPy150Open mozilla/kitsune/kitsune/dashboards/cron.py update_l10n_contributor_metrics/VarMisuse@172/299 `locale`->`previous_first_of_month`