incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [36/50] git commit: [#4504] ticket:311 Hide hits count for queries with $USER var
Date Tue, 16 Apr 2013 12:29:26 GMT
[#4504] ticket:311 Hide hits count for queries with $USER var


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/f785c524
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/f785c524
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/f785c524

Branch: refs/heads/acs2/5518
Commit: f785c5246eb7905e6fd8f083f7219ef3431ad566
Parents: f8c30d4
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Wed Apr 10 09:13:26 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Fri Apr 12 17:07:49 2013 +0000

----------------------------------------------------------------------
 ForgeTracker/forgetracker/model/ticket.py |    2 ++
 ForgeTracker/forgetracker/tracker_main.py |    3 ++-
 2 files changed, 4 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f785c524/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index c491d7b..aa8dd88 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -119,6 +119,8 @@ class Globals(MappedClass):
         self._bin_counts_data = []
         for b in Bin.query.find(dict(
                 app_config_id=self.app_config_id)):
+            if b.terms and '$USER' in b.terms:
+                continue  # skip queries with $USER variable, hits will be inconsistent for
them
             r = search_artifact(Ticket, b.terms, rows=0, short_timeout=False)
             hits = r is not None and r.hits or 0
             self._bin_counts_data.append(dict(summary=b.summary, hits=hits))

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f785c524/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 4a7562e..dfdd4a8 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -226,8 +226,9 @@ class ForgeTrackerApp(Application):
         milestones = []
         for bin in self.bins:
             label = bin.shorthand_id()
+            cls = '' if bin.terms and '$USER' in bin.terms else 'search_bin'
             search_bins.append(SitemapEntry(
-                    h.text.truncate(label, 72), bin.url(), className='search_bin'))
+                    h.text.truncate(label, 72), bin.url(), className=cls))
         for fld in c.app.globals.milestone_fields:
             milestones.append(SitemapEntry(h.text.truncate(fld.label, 72)))
             for m in getattr(fld, "milestones", []):


Mime
View raw message