diff options
| author | Arthur Koziel <arthur@arthurkoziel.com> | 2010-09-13 00:04:27 +0000 |
|---|---|---|
| committer | Arthur Koziel <arthur@arthurkoziel.com> | 2010-09-13 00:04:27 +0000 |
| commit | dd49269c7db008b2567f50cb03c4d3d9b321daa1 (patch) | |
| tree | 326dd25bb045ac016cda7966b43cbdfe1f67d699 /django/contrib/auth/decorators.py | |
| parent | c9b188c4ec939abbe48dae5a371276742e64b6b8 (diff) | |
[soc2010/app-loading] merged trunkarchive/soc2010/app-loading
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/app-loading@13818 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/contrib/auth/decorators.py')
| -rw-r--r-- | django/contrib/auth/decorators.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/contrib/auth/decorators.py b/django/contrib/auth/decorators.py index 09dcf42e42..7d7a0cddb7 100644 --- a/django/contrib/auth/decorators.py +++ b/django/contrib/auth/decorators.py @@ -30,13 +30,14 @@ def user_passes_test(test_func, login_url=None, redirect_field_name=REDIRECT_FIE return decorator -def login_required(function=None, redirect_field_name=REDIRECT_FIELD_NAME): +def login_required(function=None, redirect_field_name=REDIRECT_FIELD_NAME, login_url=None): """ Decorator for views that checks that the user is logged in, redirecting to the log-in page if necessary. """ actual_decorator = user_passes_test( lambda u: u.is_authenticated(), + login_url=login_url, redirect_field_name=redirect_field_name ) if function: |
