'Return if template is valid.'

def ensure_valid(self):

    if (self._compiled_code is not None):
        return
    try:
        self._compiled_code = ENV.compile(self.template)
    except jinja2.exceptions.TemplateSyntaxError as err:
        raise TemplateError(err)
