Skip to content
Snippets Groups Projects
Commit 7c540bc4 authored by Xavier Morel's avatar Xavier Morel
Browse files

[FIX] exception rendering with pretty printed XML

had not been migrated to lxml
parent 8472ee9f
No related branches found
No related tags found
No related merge requests found
...@@ -507,7 +507,7 @@ ...@@ -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> <t t-if="'expression' in qweb_exception.qweb">and evaluating the following expression: <code t-esc="qweb_exception.qweb['expression']"/></t>
</p> </p>
<t t-if="'node' in qweb_exception.qweb"> <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> </t>
</div> </div>
</div> </div>
......
...@@ -40,6 +40,10 @@ class QWebException(Exception): ...@@ -40,6 +40,10 @@ class QWebException(Exception):
def __init__(self, message, **kw): def __init__(self, message, **kw):
Exception.__init__(self, message) Exception.__init__(self, message)
self.qweb = dict(kw) 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): class QWebTemplateNotFound(QWebException):
pass pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment