web/views/management.py
changeset 174 a2966960d550
parent 0 b97547f5f1fa
child 237 3df2e0ae2eba
--- a/web/views/management.py	Fri Dec 05 17:26:39 2008 +0100
+++ b/web/views/management.py	Fri Dec 05 18:05:09 2008 +0100
@@ -199,11 +199,17 @@
         self.w(u'<h2>%s</h2>' % title)
         if 'errmsg' in req.data:
             ex = req.data['errmsg']
+            exclass = None
         else:
+            exclass = ex.__class__.__name__
             ex = exc_message(ex, req.encoding)
         if excinfo is not None and self.config['print-traceback']:
-            exclass = ex.__class__.__name__
-            self.w(u'<div class="tb">%s: %s</div>' % (exclass, html_escape(ex).replace("\n","<br />")))
+            if exclass is None:
+                self.w(u'<div class="tb">%s</div>'
+                       % html_escape(ex).replace("\n","<br />"))
+            else:
+                self.w(u'<div class="tb">%s: %s</div>'
+                       % (exclass, html_escape(ex).replace("\n","<br />")))
             self.w(u'<hr />')
             self.w(u'<div class="tb">%s</div>' % html_traceback(excinfo, ex, ''))
         else: