@cronjobs.register
def update_l10n_contributor_metrics(day=None):
 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=locale, product=product, date=previous_first_of_month, value=num)

@ cronjobs . register def update_l10n_contributor_metrics ( day = None ) : 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 = locale , product = product , date = previous_first_of_month , value = num )
update the number of active contributors for each locale/product .