I'm trying to "extend" django.contrib.auth.views.login in the same
fashion as a generic view. I would like to deposit points in a user's
account after a sucessful login. Here's what I've got--inspired by the
Django Book, Generic Views chapter.
def user_login(request):
response django.contrib.auth.views.login(request)
if XXX: # FIXME: how do I check that this was successful?
do database stuff...
return response
On a semi-related note, I'd probably be able to muddle through this on
my own using the Python console, but I don't know how to fake the
'request' variable in that environment; is this easy to do?
Thanks very much,
- whiteinge
In the event another nub is looking to make stuff happen post-
successful login/logout here's the (now obvious) pseudo-code solution:
def user_login(request):
response = django.contrib.auth.views.login(request)
if request.user.is_authenticated():