Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #861 from groovecoder/fix-l10n-metric-cron

fix prod l10n metric cron errors
  • Loading branch information...
commit 034a3d890e12b88fcb258cb43c9e7358529a3e76 2 parents 5bff298 + 7738d73
@lmorchard lmorchard authored
Showing with 6 additions and 5 deletions.
  1. +3 −2 apps/kpi/cron.py
  2. +3 −3 scripts/build.sh
View
5 apps/kpi/cron.py
@@ -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())
@@ -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()
View
6 scripts/build.sh
@@ -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!'
Please sign in to comment.
Something went wrong with that request. Please try again.