Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
ff4a11d2
Commit
ff4a11d2
authored
Feb 15, 2024
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: do not crash if a module does not have the business_application category
parent
beae191e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/TemplateTool_checkBusinessApplicationToModuleConsistency.py
...mplateTool_checkBusinessApplicationToModuleConsistency.py
+8
-7
No files found.
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/TemplateTool_checkBusinessApplicationToModuleConsistency.py
View file @
ff4a11d2
...
...
@@ -98,14 +98,15 @@ for business_application_id, module_name_list in [
error_list
.
append
(
"business application %s not found, please update this constraint! (ignored when solving)"
%
business_application_id
)
continue
try
:
module
.
getBusinessApplication
(
None
)
current_business_application_id
=
module
.
getBusinessApplication
(
None
)
except
AttributeError
:
current_business_application_id
=
None
raise
AttributeError
(
"%s has no business_application category"
%
(
module_name
))
if
module
.
getBusinessApplication
(
None
)
!=
business_application_id
:
if
current_business_application_id
!=
business_application_id
:
if
fixit
:
module
.
setBusinessApplicationValue
(
business_application_value
)
else
:
error_list
.
append
(
"no business application assigned to module %s (Expected: %s | Found: %s)"
%
(
module_name
,
business_application_id
,
module
.
getBusinessApplication
(
None
)
))
error_list
.
append
(
"no business application assigned to module %s (Expected: %s | Found: %s)"
%
(
module_name
,
business_application_id
,
current_business_application_id
))
# Remove business application from unused module
for
module_name
in
portal
.
contentIds
():
...
...
@@ -116,14 +117,14 @@ for module_name in portal.contentIds():
error_list
.
append
(
"module %s not found, please update this constraint! (ignored when solving)"
%
module_name
)
continue
try
:
module
.
getBusinessApplication
(
None
)
current_business_application_id
=
module
.
getBusinessApplication
(
None
)
except
AttributeError
:
raise
AttributeError
(
"%s has no business_application category"
%
(
module_name
))
if
module
.
getBusinessApplication
(
None
)
!=
None
:
current_business_application_id
=
None
if
current_business_application_id
!=
None
:
if
fixit
:
module
.
setBusinessApplicationValue
(
None
)
else
:
error_list
.
append
(
"no business application assigned to module %s (Expected: None | Found: %s)"
%
(
module_name
,
module
.
getBusinessApplication
(
None
)
))
error_list
.
append
(
"no business application assigned to module %s (Expected: None | Found: %s)"
%
(
module_name
,
current_business_application_id
))
#return "\n".join(error_list) or "OK"
return
error_list
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