I have a model with my permissions, and in my view using CBV(generic.CreateView) or (generic.DetailView), if a user logged has permissions, he can access the view, if hasn't access, the page Forbidden 403 shows.
But, if a user dont have permission for that view, I want raise exception PermissionDenied, and redirect to a specific page for this error.
My view:
class AddJob(LoginRequiredMixin, PermissionRequiredMixin, generic.CreateView)
permission required = 'can_create_job'
model = Job
fields = ['name', 'description', 'salary']
success_url = reversy_lazy('job_list)
context_object_name = 'object_name'
Can anyone help me? Thanks