mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] runbot: avoid werkzeug deprecated escape
The `utils.escape` utility was deprecated in werkzeug 2.0.0, so it can be replaced with our `html_escape` which is itself `markupsafe.escape`. Also, with this change, the double quotes are now escaped in `"` instead of `"`, so we fix the test too.
This commit is contained in:
parent
ca1246b87a
commit
a051568213
@ -13,9 +13,8 @@ from collections import OrderedDict
|
||||
from datetime import timedelta
|
||||
from babel.dates import format_timedelta
|
||||
from markupsafe import Markup
|
||||
from werkzeug import utils
|
||||
|
||||
from odoo.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
|
||||
from odoo.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT, html_escape
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@ -121,7 +120,7 @@ def list_local_dbs(additionnal_conditions=None):
|
||||
|
||||
|
||||
def pseudo_markdown(text):
|
||||
text = utils.escape(text)
|
||||
text = html_escape(text)
|
||||
|
||||
# first, extract code blocs:
|
||||
codes = []
|
||||
|
@ -129,5 +129,5 @@ class TestIrLogging(RunbotCase):
|
||||
log.message = 'foo <script>console.log("hello world")</script>'
|
||||
self.assertEqual(
|
||||
log._markdown(),
|
||||
'foo <script>console.log("hello world")</script>'
|
||||
'foo <script>console.log("hello world")</script>'
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user