Commit c39edb65 by kimth

StudentModule lookups in queue callback use target user, rather than request.user

parent 501f2ccf
...@@ -252,7 +252,7 @@ def get_shared_instance_module(user, module, student_module_cache): ...@@ -252,7 +252,7 @@ def get_shared_instance_module(user, module, student_module_cache):
else: else:
return None return None
from datetime import datetime
@csrf_exempt @csrf_exempt
def xqueue_callback(request, userid, id, dispatch): def xqueue_callback(request, userid, id, dispatch):
''' '''
...@@ -270,13 +270,12 @@ def xqueue_callback(request, userid, id, dispatch): ...@@ -270,13 +270,12 @@ def xqueue_callback(request, userid, id, dispatch):
user = User.objects.get(id=userid) user = User.objects.get(id=userid)
student_module_cache = StudentModuleCache.cache_for_descriptor_descendents(user, modulestore().get_item(id)) student_module_cache = StudentModuleCache.cache_for_descriptor_descendents(user, modulestore().get_item(id))
instance = get_module(request.user, request, id, student_module_cache) instance = get_module(user, request, id, student_module_cache)
instance_module = get_instance_module(user, instance, student_module_cache)
instance_module = get_instance_module(request.user, instance, student_module_cache)
if instance_module is None: if instance_module is None:
log.debug("Couldn't find module '%s' for user '%s'", log.debug("Couldn't find module '%s' for user '%s'",
id, request.user) id, user)
raise Http404 raise Http404
oldgrade = instance_module.grade oldgrade = instance_module.grade
......
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