--- decorators.py	2008-08-21 16:09:07.962554500 +0200
+++ decorators.py.orig	2008-08-21 16:10:22.165439900 +0200
@@ -7,17 +7,17 @@
 from django.http import HttpResponseRedirect
 from django.utils.http import urlquote
 
-def user_passes_test(test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME, noperm_url = None):
+def user_passes_test(test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME):
     """
     Decorator for views that checks that the user passes the given test,
     redirecting to the log-in page if necessary. The test should be a callable
     that takes the user object and returns True if the user passes.
     """
     def decorate(view_func):
-        return _CheckLogin(view_func, test_func, login_url, redirect_field_name, noperm_url)
+        return _CheckLogin(view_func, test_func, login_url, redirect_field_name)
     return decorate
 
-def login_required(function=None, redirect_field_name=REDIRECT_FIELD_NAME, noperm_url = None):
+def login_required(function=None, redirect_field_name=REDIRECT_FIELD_NAME):
     """
     Decorator for views that checks that the user is logged in, redirecting
     to the log-in page if necessary.
@@ -25,18 +25,17 @@
     actual_decorator = user_passes_test(
         lambda u: u.is_authenticated(),
         redirect_field_name=redirect_field_name,
-	noperm_url=noperm_url,
     )
     if function:
         return actual_decorator(function)
     return actual_decorator
 
-def permission_required(perm, login_url=None, noperm_url=None):
+def permission_required(perm, login_url=None):
     """
     Decorator for views that checks whether a user has a particular permission
     enabled, redirecting to the log-in page if necessary.
     """
-    return user_passes_test(lambda u: u.has_perm(perm), login_url=login_url, noperm_url=None)
+    return user_passes_test(lambda u: u.has_perm(perm), login_url=login_url)
 
 class _CheckLogin(object):
     """
@@ -49,31 +48,24 @@
     _CheckLogin object is used as a method decorator, the view function
     is properly bound to its instance.
     """
-    def __init__(self, view_func, test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME, noperm_url=None):
+    def __init__(self, view_func, test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME):
         if not login_url:
             from django.conf import settings
             login_url = settings.LOGIN_URL
 
-	if not noperm_url:
-	    noperm_url = '/'
-
         self.view_func = view_func
         self.test_func = test_func
         self.login_url = login_url
         self.redirect_field_name = redirect_field_name
-	self.noperm_url = noperm_url
         update_wrapper(self, view_func)
         
     def __get__(self, obj, cls=None):
         view_func = self.view_func.__get__(obj, cls)
-        return _CheckLogin(view_func, self.test_func, self.login_url, self.redirect_field_name, self.noperm_url)
+        return _CheckLogin(view_func, self.test_func, self.login_url, self.redirect_field_name)
     
     def __call__(self, request, *args, **kwargs):
         if self.test_func(request.user):
             return self.view_func(request, *args, **kwargs)
-        elif not request.user.is_authenticated(): 
-	    path = urlquote(request.get_full_path()) 
-	    tup = self.login_url, self.redirect_field_name, path 
-	    return HttpResponseRedirect('%s?%s=%s' % tup) 
-	else: 
-	    return HttpResponseRedirect('%s' % self.noperm_url) 
+	path = urlquote(request.get_full_path()) 
+	tup = self.login_url, self.redirect_field_name, path 
+	return HttpResponseRedirect('%s?%s=%s' % tup) 
