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
Titouan Soulard
slapos.core
Commits
287da4aa
Commit
287da4aa
authored
Mar 24, 2023
by
Cédric Le Ninivin
Committed by
Titouan Soulard
Sep 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Only add api_revision to JSON Data when defined
parent
88259bd7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstallation.py
...m/portal_components/document.erp5.SoftwareInstallation.py
+12
-5
master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.py
...eItem/portal_components/document.erp5.SoftwareInstance.py
+3
-1
No files found.
master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstallation.py
View file @
287da4aa
...
...
@@ -50,6 +50,9 @@ class SoftwareInstallation(Item, JSONType):
,
PropertySheet
.
JSONTypeConstraint
)
def
useRevision
(
self
):
return
getattr
(
self
,
"use_jio_api_revision"
,
False
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'asJSONText'
)
def
asJSONText
(
self
):
...
...
@@ -73,11 +76,15 @@ class SoftwareInstallation(Item, JSONType):
"status_message"
:
status_dict
.
get
(
"text"
),
"portal_type"
:
"Software Installation"
,
}
web_section
=
self
.
getWebSectionValue
()
web_section
=
web_section
.
getRelativeUrl
()
if
web_section
else
self
.
REQUEST
.
get
(
"web_section_relative_url"
,
None
)
if
web_section
:
result
[
"api_revision"
]
=
self
.
getJIOAPIRevision
(
web_section
)
result
.
update
()
if
self
.
useRevision
():
web_section
=
self
.
getWebSectionValue
()
web_section
=
web_section
.
getRelativeUrl
()
if
web_section
else
self
.
REQUEST
.
get
(
"web_section_relative_url"
,
None
)
if
web_section
:
revision
=
self
.
getJIOAPIRevision
(
web_section
)
if
revision
:
result
[
"api_revision"
]
=
revision
return
json
.
dumps
(
result
,
indent
=
2
)
def
getSlapTimestamp
(
self
):
...
...
master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.py
View file @
287da4aa
...
...
@@ -413,7 +413,9 @@ class SoftwareInstance(Item, JSONType):
web_section
=
self
.
getWebSectionValue
()
web_section
=
web_section
.
getRelativeUrl
()
if
web_section
else
self
.
REQUEST
.
get
(
"web_section_relative_url"
,
None
)
if
web_section
:
result
[
"api_revision"
]
=
self
.
getJIOAPIRevision
(
web_section
)
revision
=
self
.
getJIOAPIRevision
(
web_section
)
if
revision
:
result
[
"api_revision"
]
=
revision
self
.
REQUEST
.
response
.
setHeader
(
'Cache-Control'
,
'private, max-age=0, must-revalidate'
)
...
...
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