fix for django 1.8.2, get_template_from_string was removed

This commit is contained in:
Alex Seeholzer 2015-06-02 10:59:01 +02:00
parent f5401b6887
commit 0f69771164

View File

@ -347,7 +347,11 @@ def update_ticket(request, ticket_id, public=False):
# if comment contains some django code, like "why does {% if bla %} crash",
# then the following line will give us a crash, since django expects {% if %}
# to be closed with an {% endif %} tag.
comment = loader.get_template_from_string(comment).render(Context(context))
# get_template_from_string was removed in Django 1.8 http://django.readthedocs.org/en/1.8.x/ref/templates/upgrading.html
from django.template import Engine
comment = Engine().from_string(comment).render(Context(context))
if owner is -1 and ticket.assigned_to:
owner = ticket.assigned_to.id