X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/3ab554e979a707490d303aaa690fde92c9c643c3..d950d9fe00b2f553d253b54a380e9fa762198de2:/forum/middleware.py?ds=inline diff --git a/forum/middleware.py b/forum/middleware.py index fb0a605..1b6e26b 100644 --- a/forum/middleware.py +++ b/forum/middleware.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from urllib import urlencode from django.contrib.auth import REDIRECT_FIELD_NAME @@ -6,9 +7,10 @@ from django.core.urlresolvers import reverse from django_cas.views import login as cas_login -class ForumMiddleware: - def process_request(self, request): +class ForumMiddleware(object): + @staticmethod + def process_request(request): if request.path.startswith(reverse('pybb:index')) \ - and (not hasattr(request, 'user') or not request.user.is_authenticated()): + and (not hasattr(request, 'user') or not request.user.is_authenticated()): params = urlencode({REDIRECT_FIELD_NAME: request.get_full_path()}) return HttpResponseRedirect(reverse(cas_login) + '?' + params)