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
32d67be5
Commit
32d67be5
authored
11 years ago
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of _computed_default.
parent
72584b59
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
common/lib/xmodule/xmodule/course_module.py
+2
-2
common/lib/xmodule/xmodule/tests/test_course_module.py
+4
-0
No files found.
common/lib/xmodule/xmodule/course_module.py
View file @
32d67be5
...
...
@@ -162,8 +162,7 @@ class CourseFields(object):
discussion_blackouts
=
List
(
help
=
"List of pairs of start/end dates for discussion blackouts"
,
scope
=
Scope
.
settings
)
discussion_topics
=
Object
(
help
=
"Map of topics names to ids"
,
scope
=
Scope
.
settings
,
computed_default
=
lambda
c
:
{
'General'
:
{
'id'
:
c
.
location
.
html_id
()}},
scope
=
Scope
.
settings
)
testcenter_info
=
Object
(
help
=
"Dictionary of Test Center info"
,
scope
=
Scope
.
settings
)
announcement
=
Date
(
help
=
"Date this course is announced"
,
scope
=
Scope
.
settings
)
...
...
@@ -234,6 +233,7 @@ class CourseDescriptor(CourseFields, SequenceDescriptor):
self
.
_grading_policy
=
{}
self
.
set_grading_policy
(
self
.
grading_policy
)
CourseFields
.
discussion_topics
.
_default
=
{
'General'
:
{
'id'
:
self
.
location
.
html_id
()}}
self
.
test_center_exams
=
[]
test_center_info
=
self
.
testcenter_info
...
...
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/tests/test_course_module.py
View file @
32d67be5
...
...
@@ -171,3 +171,7 @@ class IsNewCourseTestCase(unittest.TestCase):
d
=
self
.
get_dummy_course
(
'2012-12-02T12:00'
,
end
=
'2014-9-04T12:00'
)
self
.
assertEqual
(
'Sep 04, 2014'
,
d
.
end_date_text
)
def
test_default_discussion_topics
(
self
):
d
=
self
.
get_dummy_course
(
'2012-12-02T12:00'
)
self
.
assertEqual
({
'General'
:
{
'id'
:
'i4x-test_org-test_course-course-test'
}},
d
.
discussion_topics
)
This diff is collapsed.
Click to expand it.
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