Commit 0d70ff70 authored by Mame Coumba Sall's avatar Mame Coumba Sall

Do not do empty title checking on listbox titles for dialog forms in naming convention script

parent 43ebcbd8
...@@ -134,7 +134,7 @@ def checkField(folder, form, field):\n ...@@ -134,7 +134,7 @@ def checkField(folder, form, field):\n
path += \'/listbox\'\n path += \'/listbox\'\n
for x in \'columns\', \'all_columns\':\n for x in \'columns\', \'all_columns\':\n
for id, title in field.get_value(x):\n for id, title in field.get_value(x):\n
error_message += checkTitle(path, x, title, field)\n error_message += checkTitle(path, x, title, field, form)\n
if a not in (None, "portal_catalog", "searchFolder", "objectValues",\n if a not in (None, "portal_catalog", "searchFolder", "objectValues",\n
"contentValues", "ListBox_initializeFastInput"):\n "contentValues", "ListBox_initializeFastInput"):\n
if not a.endswith(\'List\'):\n if not a.endswith(\'List\'):\n
...@@ -155,12 +155,12 @@ titlecase_sub = re.compile(r"[A-Za-z]+(\'[A-Za-z]+)?").sub\n ...@@ -155,12 +155,12 @@ titlecase_sub = re.compile(r"[A-Za-z]+(\'[A-Za-z]+)?").sub\n
titlecase_repl = lambda mo: mo.group(0)[0].upper() + mo.group(0)[1:].lower()\n titlecase_repl = lambda mo: mo.group(0)[0].upper() + mo.group(0)[1:].lower()\n
titlecase = lambda s: titlecase_sub(titlecase_repl, s)\n titlecase = lambda s: titlecase_sub(titlecase_repl, s)\n
\n \n
def checkTitle(path, id, title, field=None):\n def checkTitle(path, id, title, field=None, form=None):\n
"""\n """\n
Generic function that test the validity of a title.\n Generic function that test the validity of a title.\n
"""\n """\n
error_message = \'\'\n error_message = \'\'\n
\n if form is not None and form.pt != \'form_dialog\' or form is None:\n
if (field is not None and not field.get_value(\'hidden\') and \\\n if (field is not None and not field.get_value(\'hidden\') and \\\n
(title is None or len(title.strip()) == 0)) or (field is None and (title is None or len(title.strip()) == 0)):\n (title is None or len(title.strip()) == 0)) or (field is None and (title is None or len(title.strip()) == 0)):\n
return "%s : %s : can\'t be empty\\n" % (path, id)\n return "%s : %s : can\'t be empty\\n" % (path, id)\n
......
41091 41092
\ No newline at end of file \ No newline at end of file
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