Commit 8ffd3542 authored by Claude Paroz's avatar Claude Paroz

Guard against None value in stats sum

parent 011306fc
......@@ -1011,8 +1011,11 @@ class Release(models.Model):
).filter(language=lang, branch__releases=self, domain__dtype='ui'
).values('branch_id', 'domain_id', 'language__locale', 'part_po__translated', 'part_po__fuzzy', 'part_po__untranslated')
all_stats_d = dict([("%d-%d-%s" % (st['branch_id'], st['domain_id'], st['language__locale']),
st['part_po__translated'] + st['part_po__fuzzy'] + st['part_po__untranslated']) for st in all_stats])
all_stats_d = {
"%d-%d-%s" % (st['branch_id'], st['domain_id'], st['language__locale']): sum(filter(
None, [st['part_po__translated'], st['part_po__fuzzy'], st['part_po__untranslated']]
)) for st in all_stats
total = 0
for stat in all_pots:
key = "%d-%d-%s" % (stat.branch_id, stat.domain_id, lang.locale)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment