From cc4196a407095b803f0325513c58520ebbff82bb Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Tue, 2 May 2006 18:44:22 +0000 Subject: [PATCH] Fixed #1059 -- Fixed off-by-one line number in heading of debug error pages. git-svn-id: http://code.djangoproject.com/svn/django/trunk@2815 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/views/debug.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/django/views/debug.py b/django/views/debug.py index aa0a93b863..6d1b0d0e6c 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -100,13 +100,13 @@ def technical_500_response(request, exc_type, exc_value, tb): 'tb': tb, 'filename': filename, 'function': function, - 'lineno': lineno, + 'lineno': lineno + 1, 'vars': tb.tb_frame.f_locals.items(), 'id': id(tb), 'pre_context': pre_context, 'context_line': context_line, 'post_context': post_context, - 'pre_context_lineno': pre_context_lineno, + 'pre_context_lineno': pre_context_lineno + 1, }) tb = tb.tb_next @@ -360,11 +360,11 @@ TECHNICAL_500_TEMPLATE = """ {% if frame.context_line %}
{% if frame.pre_context %} -
    {% for line in frame.pre_context %}
  1. {{ line|escape }}
  2. {% endfor %}
+
    {% for line in frame.pre_context %}
  1. {{ line|escape }}
  2. {% endfor %}
{% endif %} -
  1. {{ frame.context_line|escape }} ...
+
  1. {{ frame.context_line|escape }} ...
{% if frame.post_context %} -
    {% for line in frame.post_context %}
  1. {{ line|escape }}
  2. {% endfor %}
+
    {% for line in frame.post_context %}
  1. {{ line|escape }}
  2. {% endfor %}
{% endif %}
{% endif %} @@ -404,7 +404,7 @@ Traceback (most recent call last):
{% for frame in frames %} File "{{ frame.filename }}" in {{ frame.function }}
{% if frame.context_line %} -   {{ frame.lineno|add:"1" }}. {{ frame.context_line|escape }}
+   {{ frame.lineno }}. {{ frame.context_line|escape }}
{% endif %} {% endfor %}
  {{ exception_type }} at {{ request.path }}