[damned-lies] Don't iterate on empty figures list



commit dc709cb216bfb2240287506b7e962a3171ac5995
Author: Claude Paroz <claude 2xlibre net>
Date:   Wed Sep 9 18:41:50 2015 +0200

    Don't iterate on empty figures list

 stats/models.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/stats/models.py b/stats/models.py
index 9c48531..03f91f7 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -1427,7 +1427,7 @@ class Statistics(models.Model):
         """ Return an enriched list of figure dicts (used in module_images.html):
             [{'path':, 'hash':, 'fuzzy':, 'translated':, 'translated_file':}, ...] """
         figures = []
-        if self.full_po and self.domain.dtype == 'doc':
+        if self.full_po and self.domain.dtype == 'doc' and self.full_po.figures:
             # something like: "https://git.gnome.org/browse/vinagre / plain / help / %s / %s ?h=master"
             url_model = utils.url_join(self.branch.get_vcs_web_url(), self.branch.img_url_prefix,
                                        self.domain.directory, '%s', '%s') + self.branch.img_url_suffix


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