Check if user is anonymous before calling PSYCHOMETRICS

LTI grade callbacks for example, come in with an anonymous user.  This causes a
stack trace in the psychometrics app that leads to the LTI service
getting a 404.  This adds a check before that callback gets registered.
This commit is contained in:
Carson Gee
2014-07-02 17:00:14 -04:00
parent a6b7fa216c
commit 87fa6cc753
2 changed files with 12 additions and 2 deletions

View File

@@ -512,8 +512,7 @@ def get_module_system_for_user(user, field_data_cache,
position = None
system.set('position', position)
if settings.FEATURES.get('ENABLE_PSYCHOMETRICS'):
if settings.FEATURES.get('ENABLE_PSYCHOMETRICS') and user.is_authenticated():
system.set(
'psychometrics_handler', # set callback for updating PsychometricsData
make_psychometrics_data_update_handler(course_id, user, descriptor.location)