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
Léo-Paul Géneau
slapos.core
Commits
75e45246
Commit
75e45246
authored
Mar 24, 2023
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Only add api_revision to JSON Data when defined
parent
47ae7595
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 @
75e45246
...
@@ -50,6 +50,9 @@ class SoftwareInstallation(Item, JSONType):
...
@@ -50,6 +50,9 @@ class SoftwareInstallation(Item, JSONType):
,
PropertySheet
.
JSONTypeConstraint
,
PropertySheet
.
JSONTypeConstraint
)
)
def
useRevision
(
self
):
return
getattr
(
self
,
"use_jio_api_revision"
,
False
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'asJSONText'
)
'asJSONText'
)
def
asJSONText
(
self
):
def
asJSONText
(
self
):
...
@@ -73,11 +76,15 @@ class SoftwareInstallation(Item, JSONType):
...
@@ -73,11 +76,15 @@ class SoftwareInstallation(Item, JSONType):
"status_message"
:
status_dict
.
get
(
"text"
),
"status_message"
:
status_dict
.
get
(
"text"
),
"portal_type"
:
"Software Installation"
,
"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
self
.
useRevision
():
if
web_section
:
web_section
=
self
.
getWebSectionValue
()
result
[
"api_revision"
]
=
self
.
getJIOAPIRevision
(
web_section
)
web_section
=
web_section
.
getRelativeUrl
()
if
web_section
else
self
.
REQUEST
.
get
(
"web_section_relative_url"
,
None
)
result
.
update
()
if
web_section
:
revision
=
self
.
getJIOAPIRevision
(
web_section
)
if
revision
:
result
[
"api_revision"
]
=
revision
return
json
.
dumps
(
result
,
indent
=
2
)
return
json
.
dumps
(
result
,
indent
=
2
)
def
getSlapTimestamp
(
self
):
def
getSlapTimestamp
(
self
):
...
...
master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.py
View file @
75e45246
...
@@ -413,7 +413,9 @@ class SoftwareInstance(Item, JSONType):
...
@@ -413,7 +413,9 @@ class SoftwareInstance(Item, JSONType):
web_section
=
self
.
getWebSectionValue
()
web_section
=
self
.
getWebSectionValue
()
web_section
=
web_section
.
getRelativeUrl
()
if
web_section
else
self
.
REQUEST
.
get
(
"web_section_relative_url"
,
None
)
web_section
=
web_section
.
getRelativeUrl
()
if
web_section
else
self
.
REQUEST
.
get
(
"web_section_relative_url"
,
None
)
if
web_section
:
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'
,
self
.
REQUEST
.
response
.
setHeader
(
'Cache-Control'
,
'private, max-age=0, must-revalidate'
)
'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