[damned-lies] Adapted stat.active once again



commit f2b4da2b1100bff7d854d0b2dd6cfcb53bffeeac
Author: Claude Paroz <claude 2xlibre net>
Date:   Sun Sep 4 20:10:02 2016 +0200

    Adapted stat.active once again

 stats/models.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/stats/models.py b/stats/models.py
index d055ed1..9f0e3e0 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -1686,6 +1686,7 @@ class Statistics(models.Model):
             br_dom_key = "%d-%d" % (stat.branch.id, stat.domain.id)
             if br_dom_key in tr_stats_dict:
                 stat = tr_stats_dict[br_dom_key]
+            stat.active = lang is not None and not module.archived
 
             # Match stat with error list
             if stat.id in infos_dict:
@@ -1695,7 +1696,8 @@ class Statistics(models.Model):
             # Search if a state exists for this statistic
             if br_dom_key in vt_states_dict:
                 stat.state = vt_states_dict[br_dom_key]
-                stat.active = lang is not None and (stat.state.name != 'None' or not module.archived)
+                if not stat.active and stat.state.name != 'None':
+                    stat.active = True
 
             stats['totaltrans'] += stat.translated(scope)
             stats['totalfuzzy'] += stat.fuzzy(scope)


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