Added task to send out email for each processed GradingRecord.
If send_mail evaluates to True in the POST data for updateProjectsForSurveyGroup task then the results of every GradingRecord will be mailed to the Student. The Mentor and Org Admins will be cc'ed.
class LazyUser(object): def __get__(self, request, obj_type=None): if not hasattr(request, '_cached_user'): from django.contrib.auth import get_user request._cached_user = get_user(request) return request._cached_userclass AuthenticationMiddleware(object): def process_request(self, request): assert hasattr(request, 'session'), "The Django authentication middleware requires session middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.sessions.middleware.SessionMiddleware'." request.__class__.user = LazyUser() return None