Get rid of _computed_default.

This commit is contained in:
cahrens
2013-05-03 16:42:41 -04:00
parent 72584b5937
commit 32d67be5f5
2 changed files with 6 additions and 2 deletions

View File

@@ -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

View File

@@ -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)