From fbb65c22c8c25a7f372764cedb610ea2b6ec6374 Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Fri, 5 Jan 2018 16:41:20 -0500 Subject: [PATCH 1/2] Fix typos in contentstore's mongo index keys "display_name" was specified as a key to two indexes, but items in the collection have the key "displayname" without an underscore. --- common/lib/xmodule/xmodule/contentstore/mongo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/contentstore/mongo.py b/common/lib/xmodule/xmodule/contentstore/mongo.py index 8482de5e27..bf3fa0645f 100644 --- a/common/lib/xmodule/xmodule/contentstore/mongo.py +++ b/common/lib/xmodule/xmodule/contentstore/mongo.py @@ -485,7 +485,7 @@ class MongoContentStore(ContentStore): [ ('_id.org', pymongo.ASCENDING), ('_id.course', pymongo.ASCENDING), - ('display_name', pymongo.ASCENDING) + ('displayname', pymongo.ASCENDING) ], sparse=True, background=True @@ -505,7 +505,7 @@ class MongoContentStore(ContentStore): [ ('content_son.org', pymongo.ASCENDING), ('content_son.course', pymongo.ASCENDING), - ('display_name', pymongo.ASCENDING) + ('displayname', pymongo.ASCENDING) ], sparse=True, background=True From 32e5679d7f863b9bb0debce5f5fffdabc6bc335f Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Fri, 5 Jan 2018 16:59:18 -0500 Subject: [PATCH 2/2] Also fix displayname typo in ensure_index comment --- common/lib/xmodule/xmodule/contentstore/mongo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/contentstore/mongo.py b/common/lib/xmodule/xmodule/contentstore/mongo.py index bf3fa0645f..2bd1123ea2 100644 --- a/common/lib/xmodule/xmodule/contentstore/mongo.py +++ b/common/lib/xmodule/xmodule/contentstore/mongo.py @@ -428,7 +428,7 @@ class MongoContentStore(ContentStore): def ensure_indexes(self): # Index needed thru 'category' by `_get_all_content_for_course` and others. That query also takes a sort - # which can be `uploadDate`, `display_name`, + # which can be `uploadDate`, `displayname`, create_collection_index( self.fs_files, [