Do not compile static templates (#49148)

self._compiled_code is unreachable if self.is_static
This commit is contained in:
J. Nick Koston 2021-04-13 04:51:56 -10:00 committed by GitHub
parent fe6d6895aa
commit 82790cd28d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -330,7 +330,7 @@ class Template:
def ensure_valid(self) -> None:
"""Return if template is valid."""
if self._compiled_code is not None:
if self.is_static or self._compiled_code is not None:
return
try: