Commit 77029076 by Calen Pennington

Make module system handle not having a user, and pass a user in when previewing in the cms

parent 82c877c0
......@@ -215,6 +215,7 @@ def preview_module_system(request, preview_id, descriptor):
render_template=render_from_lms,
debug=True,
replace_urls=replace_urls,
user=request.user,
)
......
......@@ -771,7 +771,7 @@ class ModuleSystem(object):
self.replace_urls = replace_urls
self.node_path = node_path
self.anonymous_student_id = anonymous_student_id
self.user_is_staff = user.is_staff
self.user_is_staff = user is not None and user.is_staff
def get(self, attr):
''' provide uniform access to attributes (like etree).'''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment