Self hosted FLOSS fitness/workout, nutrition and weight tracker
Update custom middleware for Django > 1.10
Scott Peshak3ca03da067a9
diff --git a/wger/utils/middleware.py b/wger/utils/middleware.pyindex a2ec858ff..3f91adcb2 100644--- a/wger/utils/middleware.py+++ b/wger/utils/middleware.py@@ -24,6 +24,7 @@ from django.conf import settingsfrom django.contrib import authfrom django.contrib.auth import login as django_loginfrom django.utils.functional import SimpleLazyObject+from django.utils.deprecation import MiddlewareMixin# wgerfrom wger.core.demo import create_temporary_user@@ -77,7 +78,7 @@ def get_user(request):return request._cached_user-class WgerAuthenticationMiddleware(object):+class WgerAuthenticationMiddleware(MiddlewareMixin):'''Small wrapper around django's own AuthenticationMiddleware. Simply createsa new user with a temporary flag if the user hits certain URLs that need@@ -91,7 +92,7 @@ class WgerAuthenticationMiddleware(object):request.user = SimpleLazyObject(lambda: get_user(request))-class RobotsExclusionMiddleware(object):+class RobotsExclusionMiddleware(MiddlewareMixin):'''Simple middleware that sends the "X-Robots-Tag" tag for the URLs used inour WgerAuthenticationMiddleware so that those pages are not indexed.@@ -103,7 +104,7 @@ class RobotsExclusionMiddleware(object):return response-class JavascriptAJAXRedirectionMiddleware(object):+class JavascriptAJAXRedirectionMiddleware(MiddlewareMixin):'''Middleware that sends helper headers when working with AJAX.