Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #822 -- Changed 500 view to use disclosure triangles instead of…

… up/down arrows. Thanks, aaronsw

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1272 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b1603563a3514eeab29780b0f4e5a54d70a7e4ff 1 parent 6be0210
Adrian Holovaty authored

Showing 1 changed file with 23 additions and 23 deletions. Show diff stats Hide diff stats

  1. 46  django/views/debug.py
46  django/views/debug.py
@@ -33,8 +33,8 @@ def technical_500_response(request, exc_type, exc_value, tb):
33 33
             'pre_context_lineno' : pre_context_lineno,
34 34
         })
35 35
         tb = tb.tb_next
36  
-    
37  
-    # Turn the settings module into a dict, filtering out anything that 
  36
+
  37
+    # Turn the settings module into a dict, filtering out anything that
38 38
     # matches HIDDEN_SETTINGS along the way.
39 39
     settings_dict = {}
40 40
     for k in dir(settings):
@@ -43,7 +43,7 @@ def technical_500_response(request, exc_type, exc_value, tb):
43 43
                 settings_dict[k] = '********************'
44 44
             else:
45 45
                 settings_dict[k] = getattr(settings, k)
46  
-                
  46
+
47 47
     t = Template(TECHNICAL_500_TEMPLATE)
48 48
     c = Context({
49 49
         'exception_type' : exc_type.__name__,
@@ -53,7 +53,7 @@ def technical_500_response(request, exc_type, exc_value, tb):
53 53
         'request' : request,
54 54
         'request_protocol' : os.environ.get("HTTPS") == "on" and "https" or "http",
55 55
         'settings' : settings_dict,
56  
-        
  56
+
57 57
     })
58 58
     return HttpResponseServerError(t.render(c))
59 59
 
@@ -66,7 +66,7 @@ def technical_404_response(request, exception):
66 66
         tried = exception.args[0]['tried']
67 67
     except (IndexError, TypeError):
68 68
         tried = []
69  
-        
  69
+
70 70
     t = Template(TECHNICAL_404_TEMPLATE)
71 71
     c = Context({
72 72
         'root_urlconf' : settings.ROOT_URLCONF,
@@ -80,7 +80,7 @@ def technical_404_response(request, exception):
80 80
 
81 81
 def _get_lines_from_file(filename, lineno, context_lines):
82 82
     """
83  
-    Returns context_lines before and after lineno from file.  
  83
+    Returns context_lines before and after lineno from file.
84 84
     Returns (pre_context_lineno, pre_context, context_line, post_context).
85 85
     """
86 86
     try:
@@ -91,7 +91,7 @@ def _get_lines_from_file(filename, lineno, context_lines):
91 91
         pre_context = [line.strip('\n') for line in source[lower_bound:lineno]]
92 92
         context_line = source[lineno].strip('\n')
93 93
         post_context = [line.strip('\n') for line in source[lineno+1:upper_bound]]
94  
-        
  94
+
95 95
         return lower_bound, pre_context, context_line, post_context
96 96
     except (OSError, IOError):
97 97
         return None, [], None, []
@@ -147,23 +147,23 @@ def _get_lines_from_file(filename, lineno, context_lines):
147 147
   <script type="text/javascript">
148 148
     function getElementsByClassName(oElm, strTagName, strClassName){
149 149
         // Written by Jonathan Snook, http://www.snook.ca/jon; Add-ons by Robert Nyman, http://www.robertnyman.com
150  
-        var arrElements = (strTagName == "*" && document.all)? document.all : 
  150
+        var arrElements = (strTagName == "*" && document.all)? document.all :
151 151
         oElm.getElementsByTagName(strTagName);
152 152
         var arrReturnElements = new Array();
153 153
         strClassName = strClassName.replace(/\-/g, "\\-");
154 154
         var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
155 155
         var oElement;
156 156
         for(var i=0; i<arrElements.length; i++){
157  
-            oElement = arrElements[i];      
  157
+            oElement = arrElements[i];
158 158
             if(oRegExp.test(oElement.className)){
159 159
                 arrReturnElements.push(oElement);
160  
-            }   
  160
+            }
161 161
         }
162 162
         return (arrReturnElements)
163 163
     }
164 164
     function hideAll(elems) {
165  
-      for (var e = 0; e < elems.length; e++) { 
166  
-        elems[e].style.display = 'none'; 
  165
+      for (var e = 0; e < elems.length; e++) {
  166
+        elems[e].style.display = 'none';
167 167
       }
168 168
     }
169 169
     window.onload = function() {
@@ -183,8 +183,8 @@ def _get_lines_from_file(filename, lineno, context_lines):
183 183
     function varToggle(link, id) {
184 184
       toggle('v' + id);
185 185
       var s = link.getElementsByTagName('span')[0];
186  
-      var uarr = String.fromCharCode(0x2191);
187  
-      var darr = String.fromCharCode(0x2193);
  186
+      var uarr = String.fromCharCode(0x25b6);
  187
+      var darr = String.fromCharCode(0x25bc);
188 188
       s.innerHTML = s.innerHTML == uarr ? darr : uarr;
189 189
       return false;
190 190
     }
@@ -225,7 +225,7 @@ def _get_lines_from_file(filename, lineno, context_lines):
225 225
     {% for frame in frames %}
226 226
       <li class="frame">
227 227
         <code>{{ frame.filename }}</code> in <code>{{ frame.function }}</code>
228  
-        
  228
+
229 229
         {% if frame.context_line %}
230 230
           <div class="context" id="c{{ frame.id }}">
231 231
             {% if frame.pre_context %}
@@ -237,10 +237,10 @@ def _get_lines_from_file(filename, lineno, context_lines):
237 237
             {% endif %}
238 238
           </div>
239 239
         {% endif %}
240  
-    
  240
+
241 241
         {% if frame.vars %}
242 242
           <div class="commands">
243  
-              <a href="#" onclick="return varToggle(this, '{{ frame.id }}')">Local vars <span>&darr;</span> </a>
  243
+              <a href="#" onclick="return varToggle(this, '{{ frame.id }}')"><span>&#x25b6;</span> Local vars</a>
244 244
           </div>
245 245
           <table class="vars" id="v{{ frame.id }}">
246 246
             <thead>
@@ -266,7 +266,7 @@ def _get_lines_from_file(filename, lineno, context_lines):
266 266
 
267 267
 <div id="requestinfo">
268 268
   <h2>Request information</h2>
269  
-  
  269
+
270 270
   <h3 id="get-info">GET</h3>
271 271
   {% if request.GET %}
272 272
     <table class="req">
@@ -288,7 +288,7 @@ def _get_lines_from_file(filename, lineno, context_lines):
288 288
   {% else %}
289 289
     <p>No GET data<p>
290 290
   {% endif %}
291  
-  
  291
+
292 292
   <h3 id="post-info">POST</h3>
293 293
   {% if request.POST %}
294 294
     <table class="req">
@@ -310,7 +310,7 @@ def _get_lines_from_file(filename, lineno, context_lines):
310 310
   {% else %}
311 311
     <p>No POST data<p>
312 312
   {% endif %}
313  
-  
  313
+
314 314
   <h3 id="cookie-info">COOKIES</h3>
315 315
   {% if request.COOKIES %}
316 316
     <table class="req">
@@ -332,7 +332,7 @@ def _get_lines_from_file(filename, lineno, context_lines):
332 332
   {% else %}
333 333
     <p>No cookie data<p>
334 334
   {% endif %}
335  
-  
  335
+
336 336
   <h3 id="meta-info">META</h3>
337 337
   <table class="req">
338 338
     <thead>
@@ -434,12 +434,12 @@ def _get_lines_from_file(filename, lineno, context_lines):
434 434
           <li>{{ pattern|escape }}</li>
435 435
         {% endfor %}
436 436
       </ol>
437  
-      <p>The current URL, <code>{{ request.path }}</code>, didn't match any of these.</p> 
  437
+      <p>The current URL, <code>{{ request.path }}</code>, didn't match any of these.</p>
438 438
     {% else %}
439 439
       <p>{{ reason|escape }}</p>
440 440
     {% endif %}
441 441
   </div>
442  
-  
  442
+
443 443
   <div id="explanation">
444 444
     <p>
445 445
       You're seeing this error because you have <code>DEBUG = True</code> in

0 notes on commit b160356

Please sign in to comment.
Something went wrong with that request. Please try again.