[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) <xmo@odoo.com>
Signed-off-by: Raphael Collet <rco@odoo.com>
This commit is contained in:
Xavier Morel
2022-05-03 13:31:03 +02:00
parent d28b17f5d3
commit 7bce4c19f3
+2 -2
View File
@@ -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])