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
9d88bef1
Commit
9d88bef1
authored
Oct 06, 2015
by
Peter Fogg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow setting `self_paced` through course details endpoint.
ECOM-2489
parent
15d77fda
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
cms/djangoapps/contentstore/tests/test_course_settings.py
+7
-0
cms/djangoapps/models/settings/course_details.py
+6
-0
No files found.
cms/djangoapps/contentstore/tests/test_course_settings.py
View file @
9d88bef1
...
...
@@ -56,6 +56,7 @@ class CourseDetailsTestCase(CourseTestCase):
self
.
assertIsNone
(
details
.
effort
,
"effort somehow initialized"
+
str
(
details
.
effort
))
self
.
assertIsNone
(
details
.
language
,
"language somehow initialized"
+
str
(
details
.
language
))
self
.
assertIsNone
(
details
.
has_cert_config
)
self
.
assertFalse
(
details
.
self_paced
)
def
test_encoder
(
self
):
details
=
CourseDetails
.
fetch
(
self
.
course
.
id
)
...
...
@@ -128,6 +129,11 @@ class CourseDetailsTestCase(CourseTestCase):
CourseDetails
.
update_from_json
(
self
.
course
.
id
,
jsondetails
.
__dict__
,
self
.
user
)
.
language
,
jsondetails
.
language
)
jsondetails
.
self_paced
=
True
self
.
assertEqual
(
CourseDetails
.
update_from_json
(
self
.
course
.
id
,
jsondetails
.
__dict__
,
self
.
user
)
.
self_paced
,
jsondetails
.
self_paced
)
@override_settings
(
MKTG_URLS
=
{
'ROOT'
:
'dummy-root'
})
def
test_marketing_site_fetch
(
self
):
...
...
@@ -334,6 +340,7 @@ class CourseDetailsViewTest(CourseTestCase):
self
.
alter_field
(
url
,
details
,
'effort'
,
"effort"
)
self
.
alter_field
(
url
,
details
,
'course_image_name'
,
"course_image_name"
)
self
.
alter_field
(
url
,
details
,
'language'
,
"en"
)
self
.
alter_field
(
url
,
details
,
'self_paced'
,
"true"
)
def
compare_details_with_encoding
(
self
,
encoded
,
details
,
context
):
"""
...
...
cms/djangoapps/models/settings/course_details.py
View file @
9d88bef1
...
...
@@ -54,6 +54,7 @@ class CourseDetails(object):
'50'
)
# minimum passing score for entrance exam content module/tree,
self
.
has_cert_config
=
None
# course has active certificate configuration
self
.
self_paced
=
None
@classmethod
def
_fetch_about_attribute
(
cls
,
course_key
,
attribute
):
...
...
@@ -86,6 +87,7 @@ class CourseDetails(object):
# Default course license is "All Rights Reserved"
course_details
.
license
=
getattr
(
descriptor
,
"license"
,
"all-rights-reserved"
)
course_details
.
has_cert_config
=
has_active_web_certificate
(
descriptor
)
course_details
.
self_paced
=
descriptor
.
self_paced
for
attribute
in
ABOUT_ATTRIBUTES
:
value
=
cls
.
_fetch_about_attribute
(
course_key
,
attribute
)
...
...
@@ -188,6 +190,10 @@ class CourseDetails(object):
descriptor
.
language
=
jsondict
[
'language'
]
dirty
=
True
if
'self_paced'
in
jsondict
and
jsondict
[
'self_paced'
]
!=
descriptor
.
self_paced
:
descriptor
.
self_paced
=
jsondict
[
'self_paced'
]
dirty
=
True
if
dirty
:
module_store
.
update_item
(
descriptor
,
user
.
id
)
...
...
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