X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/42c42960c2dce4500f12dd14a68a10ed4f06abf5..848540befacb9194af0d1e3fb11be966ade28050:/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)