1.I have a django decorator but i don't know what is the meaning of function argument, like here by default it is set to None, what does that mean and what does actual_decorator(function) means?
2.also how does the condition 'if function' returns True while my function is None
def teacher_required(function=None,):
actual_decorator = user_passes_test(
lambda u: u.is_teacher,)
if function:
return actual_decorator(function)
return actual_decorator
also what does sending argument to actual_decorator means?
another question how can i return a permission denied error on decorator failure instead of login page?