From 9ad435a8b89d7867386b5d25031e57a4745eae77 Mon Sep 17 00:00:00 2001 From: Gabe Mulley Date: Fri, 15 Nov 2013 08:47:24 -0500 Subject: [PATCH] fix emission of enrollment events from the CMS I suspect there are very few circumstances that an enrollment event is emitted from the CMS, but if it ever were to happen, it would bomb out because the "crum" middleware is not used in that app. We are hoping to replace this request caching hack in the near future, but for now it is the best option we could come up with. I noticed the stack appear when I created a new course in my dev environment. Presumably the course author is automatically enrolled in the course, which, causes the tracking code to bomb out. Luckily we catch the error and just log it, but we really should be capturing this type of enrollment event. --- cms/envs/common.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cms/envs/common.py b/cms/envs/common.py index ade7479d61..8e2788a86a 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -157,6 +157,7 @@ MIDDLEWARE_CLASSES = ( 'cache_toolbox.middleware.CacheBackedAuthenticationMiddleware', 'student.middleware.UserStandingMiddleware', 'contentserver.middleware.StaticContentServer', + 'crum.CurrentRequestUserMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'track.middleware.TrackMiddleware',