summaryrefslogtreecommitdiff
path: root/docs/request_response.txt
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2006-07-19 02:09:26 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2006-07-19 02:09:26 +0000
commit51705f60b1b561b3e44d1ff3d02bc12d7af26d9f (patch)
tree6851e452daf82d75b2265338360edfc7dac9b196 /docs/request_response.txt
parent533594d1a5a943ef80360762d5c5d021975a9bde (diff)
Fixed #2332 -- Introduced is_authenticated() method on User and AnonymousUser classes. Recommended its use over is_anonymous in the docs. Changed internal Django use to match this recommendation. Thanks to SmileyChris and Gary Wilson for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3360 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/request_response.txt')
-rw-r--r--docs/request_response.txt8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/request_response.txt b/docs/request_response.txt
index 0bcb3a7f5b..df95bc77b7 100644
--- a/docs/request_response.txt
+++ b/docs/request_response.txt
@@ -106,12 +106,12 @@ All attributes except ``session`` should be considered read-only.
A ``django.contrib.auth.models.User`` object representing the currently
logged-in user. If the user isn't currently logged in, ``user`` will be set
to an instance of ``django.contrib.auth.models.AnonymousUser``. You
- can tell them apart with ``is_anonymous()``, like so::
+ can tell them apart with ``is_authenticated()``, like so::
- if request.user.is_anonymous():
- # Do something for anonymous users.
- else:
+ if request.user.is_authenticated():
# Do something for logged-in users.
+ else:
+ # Do something for anonymous users.
``user`` is only available if your Django installation has the
``AuthenticationMiddleware`` activated. For more, see