Answers for "user passes test django"

0

user passes test django

from django.contrib.auth.decorators import user_passes_test

def email_check(user):
    return user.email.endswith('@example.com')

@user_passes_test(email_check)
def my_view(request):
    ...
Posted by: Guest on October-17-2020

Python Answers by Framework

Browse Popular Code Answers by Language