diff --git a/questionnaire/emails.py b/questionnaire/emails.py index c4173cc..b1f7f92 100644 --- a/questionnaire/emails.py +++ b/questionnaire/emails.py @@ -13,7 +13,7 @@ from django.template import loader from django.utils import translation from django.conf import settings from django.http import Http404, HttpResponse -from django.shortcuts import render_to_response, get_object_or_404 +from django.shortcuts import get_object_or_404 from .models import Subject, QuestionSet, RunInfo, Questionnaire try: from hashlib import md5 diff --git a/questionnaire/request_cache.py b/questionnaire/request_cache.py index d9330cb..95c6134 100644 --- a/questionnaire/request_cache.py +++ b/questionnaire/request_cache.py @@ -9,6 +9,13 @@ from functools import wraps from threading import currentThread from django.core.cache.backends.locmem import LocMemCache +try: + from django.utils.deprecation import MiddlewareMixin +except ImportError: + # djang0 < 1.10 + class MiddlewareMixin(object): + pass + _request_cache = {} _installed_middleware = False @@ -25,7 +32,7 @@ class RequestCache(LocMemCache): params = dict() super(RequestCache, self).__init__(name, params) -class RequestCacheMiddleware(object): +class RequestCacheMiddleware(MiddlewareMixin): def __init__(self): global _installed_middleware _installed_middleware = True