Revert reversed. Database insert vs. update bug fixed
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user