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
49807ab6
Commit
49807ab6
authored
Sep 08, 2015
by
Bill DeRusha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add search specific feature flag in front of search features
parent
62ef4b5b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
6 deletions
+12
-6
cms/envs/common.py
+3
-0
cms/envs/test.py
+3
-0
lms/djangoapps/teams/management/commands/reindex_course_team.py
+2
-2
lms/djangoapps/teams/management/commands/tests/test_reindex_course_team.py
+2
-2
lms/djangoapps/teams/search_indexes.py
+1
-1
lms/envs/aws.py
+1
-1
No files found.
cms/envs/common.py
View file @
49807ab6
...
...
@@ -170,6 +170,9 @@ FEATURES = {
# Teams feature
'ENABLE_TEAMS'
:
True
,
# Teams search feature
'ENABLE_TEAMS_SEARCH'
:
False
,
# Show video bumper in Studio
'ENABLE_VIDEO_BUMPER'
:
False
,
...
...
cms/envs/test.py
View file @
49807ab6
...
...
@@ -281,5 +281,8 @@ SEARCH_ENGINE = "search.tests.mock_search_engine.MockSearchEngine"
# teams feature
FEATURES
[
'ENABLE_TEAMS'
]
=
True
# teams search
FEATURES
[
'ENABLE_TEAMS_SEARCH'
]
=
True
# Dummy secret key for dev/test
SECRET_KEY
=
'85920908f28904ed733fe576320db18cabd7b6cd'
lms/djangoapps/teams/management/commands/reindex_course_team.py
View file @
49807ab6
...
...
@@ -53,8 +53,8 @@ class Command(BaseCommand):
if
len
(
args
)
==
0
and
not
options
.
get
(
'all'
,
False
):
raise
CommandError
(
u"reindex_course_team requires one or more arguments: <course_team_id>"
)
elif
not
settings
.
FEATURES
.
get
(
'ENABLE_TEAMS'
,
False
):
raise
CommandError
(
u"ENABLE_TEAMS must be enabled to use course team indexing"
)
elif
not
settings
.
FEATURES
.
get
(
'ENABLE_TEAMS
_SEARCH
'
,
False
):
raise
CommandError
(
u"ENABLE_TEAMS
_SEARCH
must be enabled to use course team indexing"
)
if
options
.
get
(
'all'
,
False
):
course_teams
=
CourseTeam
.
objects
.
all
()
...
...
lms/djangoapps/teams/management/commands/tests/test_reindex_course_team.py
View file @
49807ab6
...
...
@@ -39,9 +39,9 @@ class ReindexCourseTeamTest(SharedModuleStoreTestCase):
def
test_teams_search_flag_disabled_raises_command_error
(
self
):
""" Test that raises CommandError for disabled feature flag. """
with
mock
.
patch
(
'django.conf.settings.FEATURES'
)
as
features
:
features
.
return_value
=
{
"ENABLE_TEAMS"
:
False
}
features
.
return_value
=
{
"ENABLE_TEAMS
_SEARCH
"
:
False
}
with
self
.
assertRaises
(
SystemExit
),
nostderr
():
with
self
.
assertRaisesRegexp
(
CommandError
,
".* ENABLE_TEAMS must be enabled .*"
):
with
self
.
assertRaisesRegexp
(
CommandError
,
".* ENABLE_TEAMS
_SEARCH
must be enabled .*"
):
call_command
(
'reindex_course_team'
)
def
test_given_invalid_team_id_raises_command_error
(
self
):
...
...
lms/djangoapps/teams/search_indexes.py
View file @
49807ab6
...
...
@@ -19,7 +19,7 @@ class CourseTeamIndexer(object):
"""
INDEX_NAME
=
"course_team_index"
DOCUMENT_TYPE_NAME
=
"course_team"
ENABLE_SEARCH_KEY
=
"ENABLE_TEAMS"
ENABLE_SEARCH_KEY
=
"ENABLE_TEAMS
_SEARCH
"
def
__init__
(
self
,
course_team
):
self
.
course_team
=
course_team
...
...
lms/envs/aws.py
View file @
49807ab6
...
...
@@ -633,7 +633,7 @@ PDF_RECEIPT_COBRAND_LOGO_HEIGHT_MM = ENV_TOKENS.get(
if
FEATURES
.
get
(
'ENABLE_COURSEWARE_SEARCH'
)
or
\
FEATURES
.
get
(
'ENABLE_DASHBOARD_SEARCH'
)
or
\
FEATURES
.
get
(
'ENABLE_COURSE_DISCOVERY'
)
or
\
FEATURES
.
get
(
'ENABLE_TEAMS'
):
FEATURES
.
get
(
'ENABLE_TEAMS
_SEARCH
'
):
# Use ElasticSearch as the search engine herein
SEARCH_ENGINE
=
"search.elastic.ElasticSearchEngine"
...
...
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