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
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
erp5
Commits
dca4fd2e
Commit
dca4fd2e
authored
May 22, 2018
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_promise: conversion server url is in list format
parent
cb2b84b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
bt5/erp5_promise/SkinTemplateItem/portal_skins/erp5_promise/Alarm_checkPromiseConversionServer.py
..._skins/erp5_promise/Alarm_checkPromiseConversionServer.py
+7
-5
bt5/erp5_promise/SkinTemplateItem/portal_skins/erp5_promise/Alarm_installPromiseConversionServer.py
...kins/erp5_promise/Alarm_installPromiseConversionServer.py
+5
-2
No files found.
bt5/erp5_promise/SkinTemplateItem/portal_skins/erp5_promise/Alarm_checkPromiseConversionServer.py
View file @
dca4fd2e
from
Products.CMFActivity.ActiveResult
import
ActiveResult
import
json
portal
=
context
.
getPortalObject
()
portal_preferences
=
portal
.
portal_preferences
promise_url
=
portal
.
getPromiseParameter
(
'external_service'
,
'cloudooo_url'
)
promise_url_list_string
=
portal
.
getPromiseParameter
(
'external_service'
,
'cloudooo_url_list'
)
promise_url_list
=
json
.
loads
(
promise_url_list_string
.
replace
(
'
\
'
'
,
'
\
"
'
))
if
promise_url
is
None
:
if
promise_url
_list
is
None
:
return
url
=
portal_preferences
.
getPreferredDocumentConversionServerUrl
()
url
_list
=
portal_preferences
.
getPreferredDocumentConversionServerUrlList
()
active_result
=
ActiveResult
()
if
promise_url
!=
url
:
if
promise_url
_list
!=
url_list
:
severity
=
1
summary
=
"Conversion Server not configured as expected"
detail
=
"Expect %s
\
n
Got %s"
%
(
promise_url
,
url
)
detail
=
"Expect %s
\
n
Got %s"
%
(
promise_url
_list
,
url_list
)
else
:
severity
=
0
summary
=
"Nothing to do."
...
...
bt5/erp5_promise/SkinTemplateItem/portal_skins/erp5_promise/Alarm_installPromiseConversionServer.py
View file @
dca4fd2e
import
json
portal
=
context
.
getPortalObject
()
portal_preferences
=
portal
.
portal_preferences
promise_url
=
portal
.
getPromiseParameter
(
'external_service'
,
'cloudooo_url'
)
promise_url_list_string
=
portal
.
getPromiseParameter
(
'external_service'
,
'cloudooo_url_list'
)
promise_url_list
=
json
.
loads
(
promise_url_list_string
.
replace
(
'
\
'
'
,
'
\
"
'
))
system_preference
=
portal_preferences
.
getActiveSystemPreference
()
if
system_preference
is
None
:
...
...
@@ -10,5 +13,5 @@ if system_preference is None:
system_preference
.
enable
()
system_preference
.
edit
(
preferred_document_conversion_server_url
=
promise_url
,
preferred_document_conversion_server_url
_list
=
promise_url_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