I know not your code but why isn't this just `assert 'template' not in kwargs`? I feel like that's less convoluted to the brain