Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #6495 -- Fixed debug traceback HTML output in the rare case whe…

…n there is no source line to display. Thanks, Bastian Kleineidam.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7057 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 046d943148e82c4f2a9a164b6bfceb8c7dda2608 1 parent e5f7ed8
@malcolmt malcolmt authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/views/debug.py
View
4 django/views/debug.py
@@ -431,11 +431,11 @@ def _get_lines_from_file(filename, lineno, context_lines, loader=None, module_na
{% if frame.context_line %}
<div class="context" id="c{{ frame.id }}">
{% if frame.pre_context %}
- <ol start="{{ frame.pre_context_lineno }}" class="pre-context" id="pre{{ frame.id }}">{% for line in frame.pre_context %}<li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ line|escape }}</li>{% endfor %}</ol>
+ <ol start="{{ frame.pre_context_lineno }}" class="pre-context" id="pre{{ frame.id }}">{% for line in frame.pre_context %}{% if line %}<li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ line|escape }}</li>{% endif %}{% endfor %}</ol>
{% endif %}
<ol start="{{ frame.lineno }}" class="context-line"><li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ frame.context_line|escape }} <span>...</span></li></ol>
{% if frame.post_context %}
- <ol start='{{ frame.lineno|add:"1" }}' class="post-context" id="post{{ frame.id }}">{% for line in frame.post_context %}<li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ line|escape }}</li>{% endfor %}</ol>
+ <ol start='{{ frame.lineno|add:"1" }}' class="post-context" id="post{{ frame.id }}">{% for line in frame.post_context %}{% if line %}<li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ line|escape }}</li>{% endif %}{% endfor %}</ol>
{% endif %}
</div>
{% endif %}
Please sign in to comment.
Something went wrong with that request. Please try again.