1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #25847 -- Made User.is_(anonymous|authenticated) properties.

This commit is contained in:
Jeremy Lainé
2016-04-02 13:18:26 +02:00
committed by Tim Graham
parent c16b9dd8e0
commit c1aec0feda
27 changed files with 238 additions and 93 deletions

View File

@@ -235,7 +235,7 @@ We'll demonstrate this with the ``Author`` model we used in the
model = Author
def post(self, request, *args, **kwargs):
if not request.user.is_authenticated():
if not request.user.is_authenticated:
return HttpResponseForbidden()
# Look up the author we're interested in.
@@ -466,7 +466,7 @@ Our new ``AuthorDetail`` looks like this::
return context
def post(self, request, *args, **kwargs):
if not request.user.is_authenticated():
if not request.user.is_authenticated:
return HttpResponseForbidden()
self.object = self.get_object()
form = self.get_form()
@@ -552,7 +552,7 @@ template as ``AuthorDisplay`` is using on ``GET``::
model = Author
def post(self, request, *args, **kwargs):
if not request.user.is_authenticated():
if not request.user.is_authenticated:
return HttpResponseForbidden()
self.object = self.get_object()
return super(AuthorInterest, self).post(request, *args, **kwargs)