src/cm/security.py
changeset 284 730dd9fb2c77
parent 210 e4715ab65e2d
child 295 7c40b98f627f
--- a/src/cm/security.py	Fri Jun 11 11:04:23 2010 +0200
+++ b/src/cm/security.py	Thu Jul 15 16:54:29 2010 +0200
@@ -198,8 +198,7 @@
     def _dec(view_func):
         def _check_global_perm(request, *args, **kwargs):
             if must_be_logged_in and not is_authenticated(request):
-                login_url = reverse('login')
-                return HttpResponseRedirect('%s?%s=%s' % (login_url, redirect_field_name, urlquote(request.get_full_path())))
+                raise UnauthorizedException('Should be logged in')
             
             if has_perm(request, perm_name, text=None): 
                 return view_func(request, *args, **kwargs)
@@ -222,8 +221,7 @@
                 return view_func(request, *args, **kwargs)
 
             if must_be_logged_in and not is_authenticated(request):
-                login_url = reverse('login')
-                return HttpResponseRedirect('%s?%s=%s' % (login_url, redirect_field_name, urlquote(request.get_full_path())))
+                raise UnauthorizedException('Should be logged in')
             
             if 'key' in kwargs: 
                 text = get_object_or_404(Text, key=kwargs['key'])