[damned-lies] Prevent crashing when partial po stats are not available



commit 55344d0fcdf8a7bcac9c3693fcaa3623344f5e6b
Author: Claude Paroz <claude 2xlibre net>
Date:   Mon Mar 4 23:19:42 2013 +0100

    Prevent crashing when partial po stats are not available

 stats/models.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/stats/models.py b/stats/models.py
index e37a03a..61a81c7 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -1008,7 +1008,7 @@ class Release(models.Model):
         total = 0
         for stat in all_pots:
             key = "%d-%d-%s" % (stat.branch_id, stat.domain_id, lang.locale)
-            total += all_stats_d.get(key, stat.part_po.untranslated)
+            total += all_stats_d.get(key, stat.part_po and stat.part_po.untranslated or 0)
         return total
 
     def total_for_lang(self, lang):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]