Commit d0c8722d by Piotr Mitros

Revert reversed. Database insert vs. update bug fixed

parent 98efb8c0
......@@ -107,17 +107,17 @@ def render_x_module(user, request, xml_module, module_object_preload):
module_id=xml_module.get('id') #module_class.id_attribute) or ""
# Grab state from database
#s = object_cache(module_object_preload,
# user,
# module_type,
# module_id)
s = StudentModule.objects.filter(student=request.user,
module_id=module_id,
module_type = module_type)
if len(s) == 0:
s=None
else:
s=s[0]
s = object_cache(module_object_preload,
user,
module_type,
module_id)
# s = StudentModule.objects.filter(student=request.user,
# module_id=module_id,
# module_type = module_type)
# if len(s) == 0:
# s=None
# else:
# s=s[0]
if s == None: # If nothing in the database...
state=None
......@@ -141,6 +141,7 @@ def render_x_module(user, request, xml_module, module_object_preload):
module_id=module_id,
state=instance.get_state())
smod.save() # This may be optional (at least in the case of no instance in the dB)
module_object_preload.append(smod)
# Grab content
content = {'content':instance.get_html(),
"destroy_js":instance.get_destroy_js(),
......
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