I would like to create a Mixin which will: First - Check if a user is authenticated, if not, redirect to login url. If yes... Second - Check if user has a defined Profile (a user), if not, redirect to Profile creation, else, allow user to access the View.
I was planning to do sometinhg like:
class ProfileRequiredMixin(LoginRequiredMixin,PermissionRequiredMixin):
#TODO check how multiple inheritance works treating conflicting methods
'''This Mixin should first check if user is autheticated, if not,
redirect to login. If it is, check if it has a profile.
If it does not, redirect to profile creation url. If it has, allow
access to view.'''
pass
But I am confused as how to overwrite the handle_no_permission()
and dispatch()
methods.