Fixed #19632 -- Bug in code sample.

Thanks grossmanandy at bfusa com and Simon Charette.
This commit is contained in:
Aymeric Augustin 2013-01-18 20:50:12 +01:00
parent 56f34f9f22
commit 1dd7492843
1 changed files with 1 additions and 1 deletions

View File

@ -466,7 +466,7 @@ checks to make sure the user has an email in the desired domain::
from django.contrib.auth.decorators import user_passes_test from django.contrib.auth.decorators import user_passes_test
def email_check(user): def email_check(user):
return '@example.com' in request.user.email return '@example.com' in user.email
@user_passes_test(email_check) @user_passes_test(email_check)
def my_view(request): def my_view(request):