Context shoud be dict on render_email_template()

template.Context intance is no longer accepted
This commit is contained in:
Santiago L 2021-05-20 14:08:09 +02:00
parent a2927f7616
commit 6d8a2ced53
1 changed files with 2 additions and 5 deletions

View File

@ -10,12 +10,9 @@ def render_email_template(template, context):
Renders an email template with this format:
{% if subject %}Subject{% endif %}
{% if message %}Email body{% endif %}
context can be a dictionary or a template.Context instance
context must be a dict
"""
if isinstance(context, dict):
context = Context(context)
if not 'site' in context:
from orchestra import settings
url = urlparse(settings.ORCHESTRA_SITE_URL)