From 7bce4c19f3d9bd251cf90114921a6351647b6b4d Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 8 Apr 2022 06:10:24 +0000 Subject: [PATCH] [IMP] web_editor: cleanup channels regex Model pattern was too permissive, separator is the literal `.` character, not any random thing. Also remove unnecessary bracket expression, it's unnecessary when matching a single item. OPW-2836106 closes odoo/odoo#90107 X-original-commit: 320cdb4e85cb86915fa25cfda8f17e0a372e765e Signed-off-by: Xavier Morel (xmo) Signed-off-by: Raphael Collet --- addons/web_editor/controllers/bus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web_editor/controllers/bus.py b/addons/web_editor/controllers/bus.py index 67e329119cb..4bff8b037f5 100644 --- a/addons/web_editor/controllers/bus.py +++ b/addons/web_editor/controllers/bus.py @@ -18,8 +18,8 @@ class EditorCollaborationController(BusController): channels = list(channels) for channel in channels: if isinstance(channel, str): - match = re.match(r'editor_collaboration:(\w+(?:.\w+)*):(\w+):([\d]+)', channel) - if (match): + match = re.match(r'editor_collaboration:(\w+(?:\.\w+)*):(\w+):(\d+)', channel) + if match: model_name = match[1] field_name = match[2] res_id = int(match[3])