I might be misunderstanding how this works - but are these two functions necessary? Why take this approach instead of simply replacing the view decorators with:

    @method_decorator(user_passes_test(EXPLORER_PERMISSION_CHANGE))

I find it a little confusing that there are now multiple functions called sql_explorer_view and sql_explorer_change. Maybe I'm wrong to think that :) I've never really used this particular decorator, so if you have some best practices, I'd love to hear them.