From 264ca65640fbe3bd8e9ba16683c5c3a81fb781fb Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Mon, 25 Mar 2013 09:37:00 -0400 Subject: [PATCH] Add some comments --- common/lib/xmodule/xmodule/course_module.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 4f68d4ba5b..b1e5fa02c8 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -1,6 +1,6 @@ import logging from cStringIO import StringIO -from math import exp, erf +from math import exp from lxml import etree from path import path # NOTE (THK): Only used for detecting presence of syllabus import requests @@ -24,9 +24,8 @@ log = logging.getLogger(__name__) class StringOrDate(Date): def from_json(self, value): """ - Parse an optional metadata key containing a time: if present, complain - if it doesn't parse. - Return None if not present or invalid. + Parse an optional metadata key containing a time or a string: + if present, assume it's a string if it doesn't parse. """ try: result = super(StringOrDate, self).from_json(value) @@ -39,7 +38,7 @@ class StringOrDate(Date): def to_json(self, value): """ - Convert a time struct to a string + Convert a time struct or string to a string. """ try: result = super(StringOrDate, self).to_json(value) @@ -176,7 +175,7 @@ class CourseFields(object): allow_anonymous_to_peers = Boolean(scope=Scope.settings, default=False) advanced_modules = List(help="Beta modules used in your course", scope=Scope.settings) has_children = True - checklists=List(scope=Scope.settings) + checklists = List(scope=Scope.settings) info_sidebar_name = String(scope=Scope.settings, default='Course Handouts') # An extra property is used rather than the wiki_slug/number because