Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
fix prod l10n metric cron errors
Browse files Browse the repository at this point in the history
some prod translations are missing modified
  • Loading branch information
groovecoder committed Feb 13, 2013
1 parent 3ac3f75 commit 7738d73
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions apps/kpi/cron.py
Expand Up @@ -16,7 +16,8 @@ def update_l10n_metric():
up_to_date_translations = 0
translations = Document.objects.exclude(locale='en-US')
for translation in translations:
if translation.modified > translation.parent.modified:
if (hasattr(translation, 'modified') and
translation.modified > translation.parent.modified):
up_to_date_translations += 1

coverage = up_to_date_translations / float(translations.count())
Expand All @@ -28,5 +29,5 @@ def update_l10n_metric():
metric, created = Metric.objects.get_or_create(kind=metric_kind,
start=start,
end=end)
metric.value = int(coverage*100) # store as a % int
metric.value = int(coverage * 100) # store as a % int
metric.save()
6 changes: 3 additions & 3 deletions scripts/build.sh
Expand Up @@ -78,10 +78,10 @@ echo "Starting tests..." `date`
export FORCE_DB='yes sir'

if [[ $1 = '--with-coverage' ]]; then
coverage run manage.py test actioncounters contentflagging dashboards demos devmo landing users wiki -v 2 --noinput
coverage xml $(find apps/actioncounters apps/contentflagging apps/dashboards apps/demos apps/devmo apps/landing apps/users apps/wiki lib -name '*.py')
coverage run manage.py test actioncounters contentflagging dashboards demos devmo kpi landing users wiki -v 2 --noinput
coverage xml $(find apps/actioncounters apps/contentflagging apps/dashboards apps/demos apps/devmo apps/kpi apps/landing apps/users apps/wiki lib -name '*.py')
else
python manage.py test actioncounters contentflagging dashboards demos devmo landing users wiki -v 2 --noinput
python manage.py test actioncounters contentflagging dashboards demos devmo kpi landing users wiki -v 2 --noinput
fi

echo 'shazam!'

0 comments on commit 7738d73

Please sign in to comment.