Fixed #6174 -- Made `AnonymousUser.is_active` False instead of True since `AnonymousUser`s can't login. Thanks, `SmileyChris`.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6912 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Gary Wilson Jr 2007-12-11 06:37:07 +00:00
parent a944613b3a
commit a4478ee9c6
2 changed files with 13 additions and 1 deletions

View File

@ -322,7 +322,7 @@ class AnonymousUser(object):
id = None
username = ''
is_staff = False
is_active = True
is_active = False
is_superuser = False
_groups = EmptyManager()
_user_permissions = EmptyManager()

View File

@ -16,9 +16,21 @@ False
>>> u2 = User.objects.create_user('testuser2', 'test2@example.com')
>>> u2.has_usable_password()
False
>>> u.is_authenticated()
True
>>> u.is_staff
False
>>> u.is_active
True
>>> a = AnonymousUser()
>>> a.is_authenticated()
False
>>> a.is_staff
False
>>> a.is_active
False
>>> a.groups.all()
[]
>>> a.user_permissions.all()