mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	Fixed #6174 -- Made AnonymousUser.is_active False instead of True since AnonymousUsers 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:
		| @@ -322,7 +322,7 @@ class AnonymousUser(object): | |||||||
|     id = None |     id = None | ||||||
|     username = '' |     username = '' | ||||||
|     is_staff = False |     is_staff = False | ||||||
|     is_active = True |     is_active = False | ||||||
|     is_superuser = False |     is_superuser = False | ||||||
|     _groups = EmptyManager() |     _groups = EmptyManager() | ||||||
|     _user_permissions = EmptyManager() |     _user_permissions = EmptyManager() | ||||||
|   | |||||||
| @@ -16,9 +16,21 @@ False | |||||||
| >>> u2 = User.objects.create_user('testuser2', 'test2@example.com') | >>> u2 = User.objects.create_user('testuser2', 'test2@example.com') | ||||||
| >>> u2.has_usable_password() | >>> u2.has_usable_password() | ||||||
| False | False | ||||||
|  |  | ||||||
|  | >>> u.is_authenticated() | ||||||
|  | True | ||||||
|  | >>> u.is_staff | ||||||
|  | False | ||||||
|  | >>> u.is_active | ||||||
|  | True | ||||||
|  |  | ||||||
| >>> a = AnonymousUser() | >>> a = AnonymousUser() | ||||||
|  | >>> a.is_authenticated() | ||||||
|  | False | ||||||
| >>> a.is_staff | >>> a.is_staff | ||||||
| False | False | ||||||
|  | >>> a.is_active | ||||||
|  | False | ||||||
| >>> a.groups.all() | >>> a.groups.all() | ||||||
| [] | [] | ||||||
| >>> a.user_permissions.all() | >>> a.user_permissions.all() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user