Skip to content
Browse files

Fixed #18093 -- Added a pk to AnonymousUser.

  • Loading branch information...
1 parent c970bcf commit b1155adcde0282a533a5ad1d7220adbd52011230 @aaugustin aaugustin committed
Showing with 2 additions and 0 deletions.
  1. +1 −0 django/contrib/auth/models.py
  2. +1 −0 django/contrib/auth/tests/basic.py
View
1 django/contrib/auth/models.py
@@ -404,6 +404,7 @@ def get_profile(self):
class AnonymousUser(object):
id = None
+ pk = None
username = ''
is_staff = False
is_active = False
View
1 django/contrib/auth/tests/basic.py
@@ -52,6 +52,7 @@ def test_user_no_email(self):
def test_anonymous_user(self):
"Check the properties of the anonymous user"
a = AnonymousUser()
+ self.assertEqual(a.pk, None)
self.assertFalse(a.is_authenticated())
self.assertFalse(a.is_staff)
self.assertFalse(a.is_active)

0 comments on commit b1155ad

Please sign in to comment.
Something went wrong with that request. Please try again.