user passes test django

Solutions on MaxInterview for user passes test django by the best coders in the world

showing results for - "user passes test django"
Christian
25 Jan 2020
1from django.contrib.auth.decorators import user_passes_test
2
3def email_check(user):
4    return user.email.endswith('@example.com')
5
6@user_passes_test(email_check)
7def my_view(request):
8    ...
9