Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Frederic Thoma
erp5
Commits
591853b3
Commit
591853b3
authored
Feb 25, 2016
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_upgrader: applies naming convention in the script CategoryTool_checkCategoryNameConsistency
parent
f19b3a4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/CategoryTool_checkCategoryNameConsistency.xml
...p5_upgrader/CategoryTool_checkCategoryNameConsistency.xml
+12
-12
No files found.
bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/CategoryTool_checkCategoryNameConsistency.xml
View file @
591853b3
...
...
@@ -70,29 +70,29 @@ if not upgrade_list:\n
\n
for old_category_name, new_category_name in upgrade_list:\n
\n
sensitive_portal_type
s
= []\n
sensitive_portal_type
_list
= []\n
\n
# We gather portal types having the new category defined as a property\n
for portal_type in portal.portal_types.listTypeInfo():\n
if new_category_name in portal_type.getInstancePropertyAndBaseCategoryList():\n
sensitive_portal_type
s
.append(portal_type.getId())\n
sensitive_portal_type
_list
.append(portal_type.getId())\n
\n
# if sensitive_portal_type
s
is empty, we don\'t want to check all objects\n
if fixit and sensitive_portal_type
s
:\n
# if sensitive_portal_type
_list
is empty, we don\'t want to check all objects\n
if fixit and sensitive_portal_type
_list
:\n
updateRelatedCategory = portal.portal_categories.updateRelatedCategory\n
\n
# We list objects defined by the sensitive portal types\n
for obj in portal.portal_catalog(portal_type=sensitive_portal_type
s
):\n
for obj in portal.portal_catalog(portal_type=sensitive_portal_type
_list
):\n
obj = obj.getObject()\n
new_categor
ies
_list = []\n
obj
_categories
_list = obj.getCategoriesList()\n
for category in obj
_categories
_list:\n
new_categor
y
_list = []\n
obj
ect_category
_list = obj.getCategoriesList()\n
for category in obj
ect_category
_list:\n
new_category = updateRelatedCategory(category, old_category_name, new_category_name)\n
new_categor
ies
_list.append(new_category)\n
if new_categor
ies_list != obj_categories
_list:\n
obj.setCategoriesList(new_categor
ies
_list)\n
new_categor
y
_list.append(new_category)\n
if new_categor
y_list != object_category
_list:\n
obj.setCategoriesList(new_categor
y
_list)\n
\n
for portal_type in sensitive_portal_type
s
:\n
for portal_type in sensitive_portal_type
_list
:\n
error_list.append(\'Portal Type %s still contains the category %s\' % (portal_type, old_category_name))\n
\n
return error_list\n
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment