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
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
Łukasz Nowak
slapos.core
Commits
2732f0be
Commit
2732f0be
authored
Jul 28, 2014
by
Alain Takoudjou
Committed by
Rafael Monnerat
Jul 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use try..except with no specific exception
parent
8fbdb701
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareProduct_getSortedSoftwareReleaseList.xml
...os_cloud/SoftwareProduct_getSortedSoftwareReleaseList.xml
+10
-7
No files found.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareProduct_getSortedSoftwareReleaseList.xml
View file @
2732f0be
...
@@ -56,14 +56,16 @@ portal = context.getPortalObject()\n
...
@@ -56,14 +56,16 @@ portal = context.getPortalObject()\n
\n
\n
if software_product_reference is None:\n
if software_product_reference is None:\n
assert(software_release_url is not None)\n
assert(software_release_url is not None)\n
try:\n
software_release = portal.portal_catalog.getResultValue(\n
software_product_reference = portal.portal_catalog.getResultValue(\n
portal_type=\'Software Release\',\n
portal_type=\'Software Release\',\n
url_string=software_release_url\n
url_string=software_release_url\n
).getAggregateValue().getReference()\n
)\n
except:\n
if not software_release:\n
# Could not find Software Release or Software Product\n
return []\n
return []\n
software_product_reference = software_release.getAggregateReference()\n
if not software_product_reference:\n
return []\n
\n
else:\n
else:\n
# Don\'t accept both parameters\n
# Don\'t accept both parameters\n
assert(software_release_url is None)\n
assert(software_release_url is None)\n
...
@@ -78,14 +80,15 @@ if not product_list:\n
...
@@ -78,14 +80,15 @@ if not product_list:\n
if len(product_list) >
1:\n
if len(product_list) >
1:\n
raise NotImplementedError(\'Several Software Product with the same title.\')\n
raise NotImplementedError(\'Several Software Product with the same title.\')\n
\n
\n
software_release_list = product_list[0].getAggregateRelatedValueList()\n
software_release_list = sorted(\n
software_release_list = sorted(\n
product_list[0].getAggregateRelatedValueList()
,\n
software_release_list
,\n
key=lambda software_release: software_release.getCreationDate(),\n
key=lambda software_release: software_release.getCreationDate(),\n
reverse=True,\n
reverse=True,\n
)\n
)\n
\n
\n
return [software_release for software_release in software_release_list\n
return [software_release for software_release in software_release_list\n
if software_release.getValidationState() in
\n
if software_release.getValidationState() in\n
["published"]\n
["published"]\n
]\n
]\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