Commit 9f796232 authored by Jérome Perrin's avatar Jérome Perrin

ToolComponent: ignore SMS / OAuth in meta_type check

Using the simple "space separated" name, expected meta type for SMSTool
is "ERP5 S M S Tool", which is not OK because in naming conventions SMS is
an exception. Same for OAuthTool / "ERP5 O Auth Tool"
parent dfae1e2b
......@@ -59,6 +59,11 @@ class ToolComponent(DocumentComponent):
if not error_list:
expected_meta_type = 'ERP5 ' + ''.join([(c if c.islower() else ' ' + c)
for c in self.getReference()]).strip()
# XXX Handle a few exceptions, following the same rules as in
# ERP5Site_checkNamingConventions
expected_meta_type = expected_meta_type\
.replace(' S M S ', ' SMS ')\
.replace(' O Auth ', ' OAuth ')
if re.search(r'^\s*meta_type\s*=\s*[\'"]%s[\'"]\s*$' % expected_meta_type,
self.getTextContent(), re.MULTILINE) is None:
error_list.append(ConsistencyMessage(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment