From afa81a914b65fccc8126db98bc3d3cf0987ede3d Mon Sep 17 00:00:00 2001
From: Bastian Kleineidam <calvin@debian.org>
Date: Sun, 27 Jan 2008 21:52:54 +0100
Subject: Fix traceback HTML syntax
Don't render empty <li> list elements due to empty traceback lines.
Signed-off-by: Bastian Kleineidam <calvin@debian.org>
diff --git a/django/views/debug.py b/django/views/debug.py
index 1193a81..09393a7 100644
a
|
b
|
TECHNICAL_500_TEMPLATE = """
|
442 | 442 | {% if frame.context_line %} |
443 | 443 | <div class="context" id="c{{ frame.id }}"> |
444 | 444 | {% if frame.pre_context %} |
445 | | <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> |
| 445 | <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> |
446 | 446 | {% endif %} |
447 | 447 | <ol start="{{ frame.lineno }}" class="context-line"><li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ frame.context_line|escape }} <span>...</span></li></ol> |
448 | 448 | {% if frame.post_context %} |
449 | | <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> |
| 449 | <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> |
450 | 450 | {% endif %} |
451 | 451 | </div> |
452 | 452 | {% endif %} |