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
926c745a
Unverified
Commit
926c745a
authored
Nov 16, 2017
by
Christopher Lee
Committed by
GitHub
Nov 16, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16372 from proversity-org/proversity/default-course-mobile-availability
add DEFAULT_MOBILE_AVAILABLE flag
parents
d6970826
f38e5ab9
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
34 additions
and
11 deletions
+34
-11
cms/envs/aws.py
+6
-0
cms/envs/common.py
+2
-0
common/lib/xmodule/xmodule/course_module.py
+5
-1
lms/djangoapps/course_api/tests/test_api.py
+2
-2
lms/djangoapps/course_api/tests/test_serializers.py
+1
-1
lms/djangoapps/course_api/tests/test_views.py
+2
-2
lms/djangoapps/courseware/tests/test_courses.py
+3
-2
lms/envs/aws.py
+5
-0
lms/envs/common.py
+1
-0
lms/envs/test.py
+2
-0
openedx/core/djangoapps/content/course_overviews/tests/test_course_overviews.py
+5
-3
No files found.
cms/envs/aws.py
View file @
926c745a
...
...
@@ -107,6 +107,12 @@ if STATIC_URL_BASE:
# DEFAULT_COURSE_ABOUT_IMAGE_URL specifies the default image to show for courses that don't provide one
DEFAULT_COURSE_ABOUT_IMAGE_URL
=
ENV_TOKENS
.
get
(
'DEFAULT_COURSE_ABOUT_IMAGE_URL'
,
DEFAULT_COURSE_ABOUT_IMAGE_URL
)
# DEFAULT_MOBILE_AVAILABLE specifies if the course is available for mobile by default
DEFAULT_MOBILE_AVAILABLE
=
ENV_TOKENS
.
get
(
'DEFAULT_MOBILE_AVAILABLE'
,
DEFAULT_MOBILE_AVAILABLE
)
# MEDIA_ROOT specifies the directory where user-uploaded files are stored.
MEDIA_ROOT
=
ENV_TOKENS
.
get
(
'MEDIA_ROOT'
,
MEDIA_ROOT
)
MEDIA_URL
=
ENV_TOKENS
.
get
(
'MEDIA_URL'
,
MEDIA_URL
)
...
...
cms/envs/common.py
View file @
926c745a
...
...
@@ -109,6 +109,8 @@ from lms.envs.common import (
PASSWORD_RESET_SUPPORT_LINK
,
ACTIVATION_EMAIL_SUPPORT_LINK
,
DEFAULT_MOBILE_AVAILABLE
,
CONTACT_EMAIL
,
DISABLE_ACCOUNT_ACTIVATION_REQUIREMENT_SWITCH
,
...
...
common/lib/xmodule/xmodule/course_module.py
View file @
926c745a
...
...
@@ -7,6 +7,8 @@ from cStringIO import StringIO
from
datetime
import
datetime
,
timedelta
import
dateutil.parser
from
django.conf
import
settings
import
requests
from
lazy
import
lazy
from
lxml
import
etree
...
...
@@ -32,6 +34,8 @@ CATALOG_VISIBILITY_CATALOG_AND_ABOUT = "both"
CATALOG_VISIBILITY_ABOUT
=
"about"
CATALOG_VISIBILITY_NONE
=
"none"
DEFAULT_MOBILE_AVAILABLE
=
getattr
(
settings
,
'DEFAULT_MOBILE_AVAILABLE'
,
False
)
class
StringOrDate
(
Date
):
def
from_json
(
self
,
value
):
...
...
@@ -337,7 +341,7 @@ class CourseFields(object):
mobile_available
=
Boolean
(
display_name
=
_
(
"Mobile Course Available"
),
help
=
_
(
"Enter true or false. If true, the course will be available to mobile devices."
),
default
=
False
,
default
=
DEFAULT_MOBILE_AVAILABLE
,
scope
=
Scope
.
settings
)
video_upload_pipeline
=
Dict
(
...
...
lms/djangoapps/course_api/tests/test_api.py
View file @
926c745a
...
...
@@ -158,7 +158,7 @@ class TestGetCourseListMultipleCourses(CourseListTestMixin, ModuleStoreTestCase)
def
setUp
(
self
):
super
(
TestGetCourseListMultipleCourses
,
self
)
.
setUp
()
self
.
course
=
self
.
create_course
()
self
.
course
=
self
.
create_course
(
mobile_available
=
False
)
self
.
staff_user
=
self
.
create_user
(
"staff"
,
is_staff
=
True
)
self
.
honor_user
=
self
.
create_user
(
"honor"
,
is_staff
=
False
)
...
...
@@ -191,7 +191,7 @@ class TestGetCourseListMultipleCourses(CourseListTestMixin, ModuleStoreTestCase)
def
test_filter
(
self
):
# Create a second course to be filtered out of queries.
alternate_course
=
self
.
create_course
(
course
=
'mobile'
,
mobile_available
=
True
)
alternate_course
=
self
.
create_course
(
course
=
'mobile'
)
test_cases
=
[
(
None
,
[
alternate_course
,
self
.
course
]),
...
...
lms/djangoapps/course_api/tests/test_serializers.py
View file @
926c745a
...
...
@@ -70,7 +70,7 @@ class TestCourseSerializer(CourseApiFactoryMixin, ModuleStoreTestCase):
'blocks_url'
:
u'http://testserver/api/courses/v1/blocks/?course_id=edX
%2
Ftoy
%2
F2012_Fall'
,
'effort'
:
u'6 hours'
,
'pacing'
:
'instructor'
,
'mobile_available'
:
Fals
e
,
'mobile_available'
:
Tru
e
,
'hidden'
:
False
,
'invitation_only'
:
False
,
...
...
lms/djangoapps/course_api/tests/test_views.py
View file @
926c745a
...
...
@@ -106,7 +106,7 @@ class CourseListViewTestCaseMultipleCourses(CourseApiTestViewMixin, ModuleStoreT
def
setUp
(
self
):
super
(
CourseListViewTestCaseMultipleCourses
,
self
)
.
setUp
()
self
.
course
=
self
.
create_course
()
self
.
course
=
self
.
create_course
(
mobile_available
=
False
)
self
.
url
=
reverse
(
'course-list'
)
self
.
staff_user
=
self
.
create_user
(
username
=
'staff'
,
is_staff
=
True
)
self
.
honor_user
=
self
.
create_user
(
username
=
'honor'
,
is_staff
=
False
)
...
...
@@ -139,7 +139,7 @@ class CourseListViewTestCaseMultipleCourses(CourseApiTestViewMixin, ModuleStoreT
self
.
setup_user
(
self
.
staff_user
)
# Create a second course to be filtered out of queries.
alternate_course
=
self
.
create_course
(
course
=
'mobile'
,
mobile_available
=
True
)
alternate_course
=
self
.
create_course
(
course
=
'mobile'
)
test_cases
=
[
(
None
,
[
alternate_course
,
self
.
course
]),
...
...
lms/djangoapps/courseware/tests/test_courses.py
View file @
926c745a
...
...
@@ -150,8 +150,9 @@ class CoursesTest(ModuleStoreTestCase):
Verify that filtering performs as expected.
"""
user
=
UserFactory
.
create
()
non_mobile_course
=
CourseFactory
.
create
(
emit_signals
=
True
)
mobile_course
=
CourseFactory
.
create
(
mobile_available
=
True
,
emit_signals
=
True
)
mobile_course
=
CourseFactory
.
create
(
emit_signals
=
True
)
non_mobile_course
=
\
CourseFactory
.
create
(
mobile_available
=
False
,
emit_signals
=
True
)
test_cases
=
(
(
None
,
{
non_mobile_course
.
id
,
mobile_course
.
id
}),
...
...
lms/envs/aws.py
View file @
926c745a
...
...
@@ -761,6 +761,11 @@ COURSE_ABOUT_VISIBILITY_PERMISSION = ENV_TOKENS.get(
COURSE_ABOUT_VISIBILITY_PERMISSION
)
DEFAULT_MOBILE_AVAILABLE
=
ENV_TOKENS
.
get
(
'DEFAULT_MOBILE_AVAILABLE'
,
DEFAULT_MOBILE_AVAILABLE
)
# Enrollment API Cache Timeout
ENROLLMENT_COURSE_DETAILS_CACHE_TIMEOUT
=
ENV_TOKENS
.
get
(
'ENROLLMENT_COURSE_DETAILS_CACHE_TIMEOUT'
,
60
)
...
...
lms/envs/common.py
View file @
926c745a
...
...
@@ -2966,6 +2966,7 @@ COURSE_CATALOG_VISIBILITY_PERMISSION = 'see_exists'
# visible. We default this to the legacy permission 'see_exists'.
COURSE_ABOUT_VISIBILITY_PERMISSION
=
'see_exists'
DEFAULT_MOBILE_AVAILABLE
=
True
# Enrollment API Cache Timeout
ENROLLMENT_COURSE_DETAILS_CACHE_TIMEOUT
=
60
...
...
lms/envs/test.py
View file @
926c745a
...
...
@@ -83,6 +83,8 @@ FEATURES['ENABLE_ENROLLMENT_TRACK_USER_PARTITION'] = True
FEATURES
[
'ENABLE_BULK_ENROLLMENT_VIEW'
]
=
True
DEFAULT_MOBILE_AVAILABLE
=
True
# Need wiki for courseware views to work. TODO (vshnayder): shouldn't need it.
WIKI_ENABLED
=
True
...
...
openedx/core/djangoapps/content/course_overviews/tests/test_course_overviews.py
View file @
926c745a
...
...
@@ -478,8 +478,9 @@ class CourseOverviewTestCase(CatalogIntegrationMixin, ModuleStoreTestCase):
)
def
test_get_all_courses_by_mobile_available
(
self
):
non_mobile_course
=
CourseFactory
.
create
(
emit_signals
=
True
)
mobile_course
=
CourseFactory
.
create
(
mobile_available
=
True
,
emit_signals
=
True
)
mobile_course
=
CourseFactory
.
create
(
emit_signals
=
True
)
non_mobile_course
=
\
CourseFactory
.
create
(
mobile_available
=
False
,
emit_signals
=
True
)
test_cases
=
(
(
None
,
{
non_mobile_course
.
id
,
mobile_course
.
id
}),
...
...
@@ -495,7 +496,8 @@ class CourseOverviewTestCase(CatalogIntegrationMixin, ModuleStoreTestCase):
CourseOverview
.
get_all_courses
(
filter_
=
filter_
)
},
expected_courses
,
"testing CourseOverview.get_all_courses with filter_={}"
.
format
(
filter_
),
"testing CourseOverview.get_all_courses with filter_={}"
.
format
(
filter_
),
)
def
test_get_from_ids_if_exists
(
self
):
...
...
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