Skip to content

Commit 3b93a2c

Browse files
committed
fix(templatetags): csrf_token was not present in context
1 parent 131cf69 commit 3b93a2c

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

allauth/templatetags/allauth.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,14 @@ def render(self, context):
111111
tags = attrs.get("tags")
112112
if tags:
113113
attrs["tags"] = [tag.strip() for tag in tags.split(",")]
114-
return render_to_string(
115-
template_names,
116-
{
117-
"attrs": attrs,
118-
"slots": slots,
119-
"origin": self.origin.template_name.replace(
120-
f".{TEMPLATE_EXTENSION}", ""
121-
),
122-
},
123-
)
114+
with context.push(
115+
slots=slots,
116+
attrs=attrs,
117+
origin=self.origin.template_name.replace(f".{TEMPLATE_EXTENSION}", ""),
118+
) as element_context:
119+
return render_to_string(
120+
template_names, element_context.context.flatten()
121+
)
124122

125123

126124
@register.tag(name="setvar")

0 commit comments

Comments
 (0)