I am trying to decorate a Django view by two decorators, one for checking login, and one for checking is_active.
The first one is the built-in @login_required<
To explain it a bit more (I was also confused at first): active_required
is applied first in a sense that it takes my_view
and wraps it in some code. Then login_required
is applied and wraps the result in some more code.
But when this wrapped version of my_view
is actually invoked, first the code added by login_required
is executed (checking that you're logged in), then the code added by active_required
is executed (checking that you're active) and then finally my_view
is executed.