Fix errors from running unit tests (some tests still fail)
This commit is contained in:
@@ -226,9 +226,9 @@ def _has_access_descriptor(user, descriptor, action, course_context=None):
|
||||
return True
|
||||
|
||||
# Check start date
|
||||
if descriptor.start is not None:
|
||||
if descriptor.lms.start is not None:
|
||||
now = time.gmtime()
|
||||
if now > descriptor.start:
|
||||
if now > descriptor.lms.start:
|
||||
# after start date, everyone can see it
|
||||
debug("Allow: now > start date")
|
||||
return True
|
||||
|
||||
@@ -36,6 +36,8 @@ def yield_dynamic_descriptor_descendents(descriptor, module_creator):
|
||||
def get_dynamic_descriptor_children(descriptor):
|
||||
if descriptor.has_dynamic_children():
|
||||
module = module_creator(descriptor)
|
||||
if module is None:
|
||||
print "FOO", descriptor
|
||||
child_locations = module.get_children_locations()
|
||||
return [descriptor.system.load_item(child_location) for child_location in child_locations ]
|
||||
else:
|
||||
|
||||
@@ -313,9 +313,11 @@ def _get_module(user, request, location, student_module_cache, course_id, positi
|
||||
import_system = descriptor.system
|
||||
if has_access(user, location, 'staff', course_id):
|
||||
err_descriptor = ErrorDescriptor.from_xml(str(descriptor), import_system,
|
||||
org=descriptor.location.org, course=descriptor.location.course,
|
||||
error_msg=exc_info_to_str(sys.exc_info()))
|
||||
else:
|
||||
err_descriptor = NonStaffErrorDescriptor.from_xml(str(descriptor), import_system,
|
||||
org=descriptor.location.org, course=descriptor.location.course,
|
||||
error_msg=exc_info_to_str(sys.exc_info()))
|
||||
|
||||
# Make an error module
|
||||
|
||||
Reference in New Issue
Block a user