Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Changed slightly misleading example in docs/sessions.txt to use bagga…

…ge-less 'members' instead of 'users'

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1211 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 46083845d4125ea6c7da66b81cd8bdd9ec6ac067 1 parent 23c9e2a
Adrian Holovaty authored November 13, 2005

Showing 1 changed file with 6 additions and 6 deletions. Show diff stats Hide diff stats

  1. 12  docs/sessions.txt
12  docs/sessions.txt
@@ -92,21 +92,21 @@ posts a comment. It doesn't let a user post a comment more than once::
92 92
         request.session['has_commented'] = True
93 93
         return HttpResponse('Thanks for your comment!')
94 94
 
95  
-This simplistic view logs a user in::
  95
+This simplistic view logs in a "member" of the site::
96 96
 
97 97
     def login(request):
98  
-        u = users.get_object(username__exact=request.POST['username'])
99  
-        if u.check_password(request.POST['password']):
100  
-            request.session['user_id'] = u.id
  98
+        m = members.get_object(username__exact=request.POST['username'])
  99
+        if m.password == request.POST['password']:
  100
+            request.session['member_id'] = m.id
101 101
             return HttpResponse("You're logged in.")
102 102
         else:
103 103
             return HttpResponse("Your username and password didn't match.")
104 104
 
105  
-...And this one logs a user out, according to ``login()`` above::
  105
+...And this one logs a member out, according to ``login()`` above::
106 106
 
107 107
     def logout(request):
108 108
         try:
109  
-            del request.session['user_id']
  109
+            del request.session['member_id']
110 110
         except KeyError:
111 111
             pass
112 112
         return HttpResponse("You're logged out.")

0 notes on commit 4608384

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