allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [23/38] git commit: [#4019] ticket:523 converted a solr_query for the ticket filtering
Date Wed, 30 Apr 2014 18:15:55 GMT
[#4019] ticket:523 converted a solr_query for the ticket filtering


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

Branch: refs/heads/master
Commit: ba35bd3e9a5b21c19fe4f637f61956339da9209a
Parents: 9188f66
Author: Yuriy Arhipov <yuriyarhipovua@yandex.ru>
Authored: Fri Jan 24 16:26:22 2014 +0400
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Apr 30 15:55:12 2014 +0000

----------------------------------------------------------------------
 ForgeTracker/forgetracker/tests/functional/test_root.py | 8 ++++++++
 ForgeTracker/forgetracker/tracker_main.py               | 6 +++++-
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/ba35bd3e/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index e2e8622..96196fe 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -2322,6 +2322,14 @@ class TestFunctionalController(TrackerTestController):
             assert 'Subject: [test:bugs] #1 test <h2> ticket' in body
             assert '<p><strong> <a class="alink" href="http://localhost/p/test/bugs/1/">[bugs:#1]</a>
test &lt;h2&gt; ticket</strong></p>' in body
 
+    @patch('forgetracker.search.query_filter_choices')
+    def test_multiselect(self, query_filter_choices):
+        self.new_ticket(summary='test')
+        self.new_ticket(summary='test2')
+        query_filter_choices.return_value = {'status': [('open', 2)], }
+        r = self.app.get('/bugs/')
+        assert '<option value="open">open (2)</label>' in r
+        query_filter_choices.assert_called_once_with('!status_s:wont-fix && !status_s:closed')
 
 class TestMilestoneAdmin(TrackerTestController):
 

http://git-wip-us.apache.org/repos/asf/allura/blob/ba35bd3e/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 64e34c4..f9d104c 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -647,9 +647,13 @@ class RootController(BaseController, FeedController):
 
         # it's just our original query mangled and sent back to us
         kw.pop('q', None)
+        solr_query = ''
+        t = TM.Ticket.query.find().first()
+        if t:
+            solr_query = t.translate_query(c.app.globals.not_closed_query, t.index())
         result = TM.Ticket.paged_query_or_search(c.app.config, c.user,
                                                  c.app.globals.not_closed_mongo_query,
-                                                 c.app.globals.not_closed_query,
+                                                 solr_query,
                                                  filter,
                                                  sort=sort, limit=int(limit), page=page,
                                                  deleted={'$in': show_deleted},


Mime
View raw message