mirror of
https://github.com/django/django.git
synced 2025-03-30 03:00:45 +00:00
Fixed #34220 -- Moved csrf_input_lazy, csrf_token_lazy imports to the toplevel.
This prevents random errors with partially initialized modules.
This commit is contained in:
parent
b47f2f5b90
commit
d5f892d873
@ -8,6 +8,7 @@ from django.utils.functional import cached_property
|
|||||||
from django.utils.module_loading import import_string
|
from django.utils.module_loading import import_string
|
||||||
|
|
||||||
from .base import BaseEngine
|
from .base import BaseEngine
|
||||||
|
from .utils import csrf_input_lazy, csrf_token_lazy
|
||||||
|
|
||||||
|
|
||||||
class Jinja2(BaseEngine):
|
class Jinja2(BaseEngine):
|
||||||
@ -62,8 +63,6 @@ class Template:
|
|||||||
)
|
)
|
||||||
|
|
||||||
def render(self, context=None, request=None):
|
def render(self, context=None, request=None):
|
||||||
from .utils import csrf_input_lazy, csrf_token_lazy
|
|
||||||
|
|
||||||
if context is None:
|
if context is None:
|
||||||
context = {}
|
context = {}
|
||||||
if request is not None:
|
if request is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user