Skip to content

Commit 5d3fd63

Browse files
authoredMay 5, 2022
Update utils.py
Add token object to context and provide to processor
1 parent 36592ea commit 5d3fd63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎drfpasswordless/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def inject_template_context(context):
110110
Injects additional context into email template.
111111
"""
112112
for processor in api_settings.PASSWORDLESS_CONTEXT_PROCESSORS:
113-
context.update(processor())
113+
context.update(processor(context))
114114
return context
115115

116116

@@ -134,7 +134,7 @@ def send_email_with_callback_token(user, email_token, **kwargs):
134134
api_settings.PASSWORDLESS_EMAIL_TOKEN_HTML_TEMPLATE_NAME)
135135

136136
# Inject context if user specifies.
137-
context = inject_template_context({'callback_token': email_token.key, })
137+
context = inject_template_context({'callback_token': email_token.key, 'token_obj': email_token })
138138
html_message = loader.render_to_string(email_html, context,)
139139
send_mail(
140140
email_subject,

0 commit comments

Comments
 (0)