allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [35/38] git commit: [#4019] ticket:560 Fixed solr query escaping for milestone controller
Date Wed, 30 Apr 2014 18:16:07 GMT
[#4019] ticket:560 Fixed solr query escaping for milestone controller


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

Branch: refs/heads/master
Commit: cafe937d9568336fa5d4a1877d0f1cf548a7619a
Parents: 1024458
Author: Ferens Dmitriy <ferensdima@gmail.com>
Authored: Fri Mar 28 14:58:03 2014 +0200
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Apr 30 15:55:15 2014 +0000

----------------------------------------------------------------------
 ForgeTracker/forgetracker/tracker_main.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/cafe937d/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 64e34c4..542f512 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -47,6 +47,7 @@ from allura.lib import helpers as h
 from allura.lib import utils
 from allura.app import Application, SitemapEntry, DefaultAdminController, ConfigOption
 from allura.lib.search import search_artifact, SearchError
+from allura.lib.solr import escape_solr_arg
 from allura.lib.decorators import require_post
 from allura.lib.security import (require_access, has_access, require,
                                  require_authenticated)
@@ -1809,10 +1810,10 @@ class MilestoneController(BaseController):
         self.root = root
         self.field = fld
         self.milestone = m
-        self.progress_key = '%s:%s' % (fld.name, m.name.replace(':', '\:'))
-        self.mongo_query = {
-            'custom_fields.%s' % fld.name: m.name}
-        self.solr_query = '%s:%s' % (_mongo_col_to_solr_col(fld.name), m.name)
+        escaped_name = escape_solr_arg(m.name)
+        self.progress_key = '%s:%s' % (fld.name, escaped_name)
+        self.mongo_query = {'custom_fields.%s' % fld.name: m.name}
+        self.solr_query = '%s:%s' % (_mongo_col_to_solr_col(fld.name), escaped_name)
 
     @with_trailing_slash
     @h.vardec


Mime
View raw message