From 40f134ed4de99e99a76fcb088dddea55ff1c4484 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Mon, 11 Mar 2013 22:23:23 -0400 Subject: [PATCH] Don't use mutable defaults for fields --- common/lib/xmodule/xmodule/course_module.py | 20 ++++++++++---------- local-requirements.txt | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 55e041e8f6..f3634d81b9 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -121,7 +121,7 @@ class Textbook(object): return table_of_contents -class TextbookList(ModelType): +class TextbookList(List): def from_json(self, values): textbooks = [] for title, book_url in values: @@ -150,19 +150,19 @@ class TextbookList(ModelType): class CourseDescriptor(SequenceDescriptor): module_class = SequenceModule - textbooks = TextbookList(help="List of pairs of (title, url) for textbooks used in this course", default=[], scope=Scope.content) + textbooks = TextbookList(help="List of pairs of (title, url) for textbooks used in this course", scope=Scope.content) wiki_slug = String(help="Slug that points to the wiki for this course", scope=Scope.content) enrollment_start = Date(help="Date that enrollment for this class is opened", scope=Scope.settings) enrollment_end = Date(help="Date that enrollment for this class is closed", scope=Scope.settings) start = Date(help="Start time when this module is visible", scope=Scope.settings) end = Date(help="Date that this class ends", scope=Scope.settings) advertised_start = StringOrDate(help="Date that this course is advertised to start", scope=Scope.settings) - grading_policy = Object(help="Grading policy definition for this class", scope=Scope.content, default={}) + grading_policy = Object(help="Grading policy definition for this class", scope=Scope.content) show_calculator = Boolean(help="Whether to show the calculator in this course", default=False, scope=Scope.settings) display_name = String(help="Display name for this module", scope=Scope.settings) tabs = List(help="List of tabs to enable in this course", scope=Scope.settings) end_of_course_survey_url = String(help="Url for the end-of-course survey", scope=Scope.settings) - discussion_blackouts = List(help="List of pairs of start/end dates for discussion blackouts", scope=Scope.settings, default=[]) + 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, @@ -175,10 +175,10 @@ class CourseDescriptor(SequenceDescriptor): no_grade = Boolean(help="True if this course isn't graded", default=False, scope=Scope.settings) disable_progress_graph = Boolean(help="True if this course shouldn't display the progress graph", default=False, scope=Scope.settings) pdf_textbooks = List(help="List of dictionaries containing pdf_textbook configuration", default=None, scope=Scope.settings) - remote_gradebook = Object(scope=Scope.settings, default={}) + remote_gradebook = Object(scope=Scope.settings) allow_anonymous = Boolean(scope=Scope.settings, default=True) allow_anonymous_to_peers = Boolean(scope=Scope.settings, default=False) - advanced_modules = List(help="Beta modules used in your course", default=[], scope=Scope.settings) + advanced_modules = List(help="Beta modules used in your course", scope=Scope.settings) has_children = True info_sidebar_name = String(scope=Scope.settings, default='Course Handouts') @@ -256,27 +256,27 @@ class CourseDescriptor(SequenceDescriptor): "min_count": 12, "drop_count": 2, "short_label": "HW", - "weight": 15 + "weight": 0.15 }, { "type": "Lab", "min_count": 12, "drop_count": 2, - "weight": 15 + "weight": 0.15 }, { "type": "Midterm Exam", "short_label": "Midterm", "min_count": 1, "drop_count": 0, - "weight": 30 + "weight": 0.3 }, { "type": "Final Exam", "short_label": "Final", "min_count": 1, "drop_count": 0, - "weight": 40 + "weight": 0.4 } ], "GRADE_CUTOFFS": { diff --git a/local-requirements.txt b/local-requirements.txt index 199af35dc0..512c6b3ff6 100644 --- a/local-requirements.txt +++ b/local-requirements.txt @@ -6,4 +6,4 @@ # XBlock: # Might change frequently, so put it in local-requirements.txt, # but conceptually is an external package, so it is in a separate repo. --e git+ssh://git@github.com/MITx/xmodule-debugger@857dcfe8#egg=XBlock +-e git+ssh://git@github.com/MITx/xmodule-debugger@6d5c2443#egg=XBlock