I have from application.utils import *
and def conditional_login_required(view_func)
in application/utils.py
but the decorator @conditional_login_required
isn’t getting called.
def conditional_login_required(view_func):
print("settings.TEST_WITHOUT_LOGIN =", settings.TEST_WITHOUT_LOGIN)
def _wrapped_view(request, *args, **kwargs):
if not settings.TEST_WITHOUT_LOGIN:
return ms_identity_web.login_required(view_func)(request, *args, **kwargs)
return view_func(request, *args, **kwargs)
return wraps(view_func)(_wrapped_view)
settings.TEST_WITHOUT_LOGIN =
never gets printed.
My view :
@conditional_login_required
def index(request):
return render(request, 'orders.html')