Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
fe28d387
Commit
fe28d387
authored
Sep 25, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only execute regex queries for case-insitive lookup in split.
[LMS-11402]
parent
2fbf67b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
common/lib/xmodule/xmodule/modulestore/split_mongo/mongo_connection.py
+9
-5
No files found.
common/lib/xmodule/xmodule/modulestore/split_mongo/mongo_connection.py
View file @
fe28d387
...
@@ -159,13 +159,17 @@ class MongoConnection(object):
...
@@ -159,13 +159,17 @@ class MongoConnection(object):
"""
"""
Get the course_index from the persistence mechanism whose id is the given key
Get the course_index from the persistence mechanism whose id is the given key
"""
"""
case_regex
=
ur"(?i)^{}$"
if
ignore_case
else
ur"{}"
if
ignore_case
:
return
self
.
course_index
.
find_one
(
query
=
{
{
key_attr
:
re
.
compile
(
u'^{}$'
.
format
(
re
.
escape
(
getattr
(
key
,
key_attr
))),
re
.
IGNORECASE
)
key_attr
:
re
.
compile
(
case_regex
.
format
(
getattr
(
key
,
key_attr
)))
for
key_attr
in
(
'org'
,
'course'
,
'run'
)
for
key_attr
in
(
'org'
,
'course'
,
'run'
)
}
}
)
else
:
query
=
{
key_attr
:
getattr
(
key
,
key_attr
)
for
key_attr
in
(
'org'
,
'course'
,
'run'
)
}
return
self
.
course_index
.
find_one
(
query
)
def
find_matching_course_indexes
(
self
,
branch
=
None
,
search_targets
=
None
):
def
find_matching_course_indexes
(
self
,
branch
=
None
,
search_targets
=
None
):
"""
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment