[damned-lies] Allow 'vertimus' access to archived module with an active state



commit 493c00daf55d389f64bb122246a62ef9e10065d1
Author: Claude Paroz <claude 2xlibre net>
Date:   Fri Aug 26 12:06:14 2016 +0200

    Allow 'vertimus' access to archived module with an active state
    
    Fixes bug #770361.

 stats/models.py                                 |    2 ++
 templates/languages/language_release_stats.html |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/stats/models.py b/stats/models.py
index e2545b6..d055ed1 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]
+
             # Match stat with error list
             if stat.id in infos_dict:
                 stat.info_list = infos_dict[stat.id]
@@ -1694,6 +1695,7 @@ 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)
 
             stats['totaltrans'] += stat.translated(scope)
             stats['totalfuzzy'] += stat.fuzzy(scope)
diff --git a/templates/languages/language_release_stats.html b/templates/languages/language_release_stats.html
index 30305dc..293eec2 100644
--- a/templates/languages/language_release_stats.html
+++ b/templates/languages/language_release_stats.html
@@ -50,7 +50,7 @@
       {% if stat and not stat.is_fake %}
         <tr id="{{ modname }}-{{ stat.domain.id }}{% if stat.tr_percentage == 100 %}-complete{% endif %}" {% 
if stat.tr_percentage == 100 %}class="completed-module"{% endif %}>
         <td class="leftcell">
-          {% if language and not module.archived %}
+          {% if stat.active %}
           <a href="{% url 'vertimus_by_names' modname branch stat.domain.name language.locale %}">{{ 
stat.module_description }}
           {% else %}
           <a href="{% url 'module' modname %}">{{ stat.module_description }}


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