mirror of
https://github.com/django/django.git
synced 2025-04-22 00:04:43 +00:00
[1.5.x] Fixed #19632 -- Bug in code sample.
Thanks grossmanandy at bfusa com and Simon Charette. Backport of 1dd7492.
This commit is contained in:
parent
ab6ff2e0ac
commit
d90abcc9da
@ -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
|
||||
|
||||
def email_check(user):
|
||||
return '@example.com' in request.user.email
|
||||
return '@example.com' in user.email
|
||||
|
||||
@user_passes_test(email_check)
|
||||
def my_view(request):
|
||||
|
Loading…
x
Reference in New Issue
Block a user