From 0f697711645e2acf8f08456c7a69f8e092d8aa4c Mon Sep 17 00:00:00 2001 From: Alex Seeholzer Date: Tue, 2 Jun 2015 10:59:01 +0200 Subject: [PATCH] fix for django 1.8.2, get_template_from_string was removed --- helpdesk/views/staff.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py index 0ea21497..e3870abe 100644 --- a/helpdesk/views/staff.py +++ b/helpdesk/views/staff.py @@ -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