[FIX] exception rendering with pretty printed XML
had not been migrated to lxml
This commit is contained in:
parent
8472ee9f45
commit
7c540bc4ee
|
@ -507,7 +507,7 @@
|
|||
<t t-if="'expression' in qweb_exception.qweb">and evaluating the following expression: <code t-esc="qweb_exception.qweb['expression']"/></t>
|
||||
</p>
|
||||
<t t-if="'node' in qweb_exception.qweb">
|
||||
<pre id="exception_node" t-esc="qweb_exception.qweb['node'].toxml()"/>
|
||||
<pre id="exception_node" t-esc="qweb_exception.pretty_xml()"/>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -40,6 +40,10 @@ class QWebException(Exception):
|
|||
def __init__(self, message, **kw):
|
||||
Exception.__init__(self, message)
|
||||
self.qweb = dict(kw)
|
||||
def pretty_xml(self):
|
||||
if 'node' not in self.qweb:
|
||||
return ''
|
||||
return etree.tostring(self.qweb['node'], pretty_print=True)
|
||||
|
||||
class QWebTemplateNotFound(QWebException):
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue