X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/87ec81224b9b1d395e78cb283beced5e6a60bb53..d2507001c717952917fc3969212a4333920356cc:/forum/middleware.py 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)