-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdjango_jinja2
25 lines (21 loc) · 1.17 KB
/
django_jinja2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
http://code.djangoproject.com/ticket/10216
bekir@debian:/usr/share/python-support/python-django/django/views$ diff -u debug.py-orig debug.py
--- debug.py-orig 2010-05-12 22:22:11.000000000 -0400
+++ debug.py 2010-05-12 22:24:22.000000000 -0400
@@ -4,7 +4,7 @@
import datetime
from django.conf import settings
-from django.template import Template, Context, TemplateDoesNotExist
+from django.template import Template, Context, TemplateDoesNotExist, TemplateSyntaxError
from django.utils.html import escape
from django.http import HttpResponse, HttpResponseServerError, HttpResponseNotFound
from django.utils.encoding import smart_unicode, smart_str
@@ -78,7 +78,7 @@
'loader': loader.__module__ + '.' + loader.__name__,
'templates': template_list,
})
- if settings.TEMPLATE_DEBUG and hasattr(self.exc_value, 'source'):
+ if (settings.TEMPLATE_DEBUG and hasattr(self.exc_value, 'source') and isinstance(self.exc_value, TemplateSyntaxError)):
self.get_template_exception_info()
frames = self.get_traceback_frames()
bekir@debian:/usr/share/python-support/python-django/django/views$