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
Xiaowu Zhang
slapos.core
Commits
8bd0a861
Commit
8bd0a861
authored
Aug 02, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: newTempDocument don't exist anymore
Those 2 scripts lack unit test
parent
0e68c46d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
28 deletions
+29
-28
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequestModule_getMonitoringUrlList.py
...m_monitoring/SupportRequestModule_getMonitoringUrlList.py
+5
-4
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequest_getInstanceMessageList.py
...s_crm_monitoring/SupportRequest_getInstanceMessageList.py
+24
-24
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequestModule_getMonitoringUrlList.py
View file @
8bd0a861
from
Products.
ERP5Type.Document
import
newTempDocumen
t
from
Products.
PythonScripts.standard
import
Objec
t
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
...
@@ -35,8 +35,9 @@ for hosting_subscription in hosting_subscription_list:
...
@@ -35,8 +35,9 @@ for hosting_subscription in hosting_subscription_list:
# bad or unknown url
# bad or unknown url
continue
continue
o
=
newTempDocument
(
portal
,
"uid_%s"
%
instance
.
getId
())
monitor_instance_list
.
append
(
o
.
edit
(
title
=
instance
.
getTitle
(),
monitor_url
=
url_string
)
Object
(
uid
=
"uid_%s"
%
instance
.
getId
(),
monitor_instance_list
.
append
(
o
)
title
=
instance
.
getTitle
(),
monitor_url
=
url_string
))
return
monitor_instance_list
return
monitor_instance_list
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequest_getInstanceMessageList.py
View file @
8bd0a861
from
Products.
ERP5Type.Document
import
newTempDocumen
t
from
Products.
PythonScripts.standard
import
Objec
t
from
DateTime
import
DateTime
from
DateTime
import
DateTime
...
@@ -36,30 +36,30 @@ if aggregate_portal_type == "Hosting Subscription":
...
@@ -36,30 +36,30 @@ if aggregate_portal_type == "Hosting Subscription":
m
,
create_at
,
since
=
instance
.
SoftwareInstance_hasReportedError
(
include_message
=
True
,
m
,
create_at
,
since
=
instance
.
SoftwareInstance_hasReportedError
(
include_message
=
True
,
include_created_at
=
True
,
include_created_at
=
True
,
include_since
=
True
)
include_since
=
True
)
message_list
.
append
(
newTempDocumen
t
(
message_list
.
append
(
Objec
t
(
document
,
instance
.
getRelativeUrl
(),
**
{
pasth
=
instance
.
getRelativeUrl
(),
"uid"
:
instance
.
getUid
(),
uid
=
instance
.
getUid
(),
"title"
:
instance
.
getTitle
(),
title
=
instance
.
getTitle
(),
"specialise_title"
:
hosting_subscription
.
getTitle
(),
specialise_title
=
hosting_subscription
.
getTitle
(),
"software_release"
:
instance
.
getUrlString
(),
software_release
=
instance
.
getUrlString
(),
"computer_reference"
:
computer
.
getReference
(),
computer_reference
=
computer
.
getReference
(),
"allocation_scope"
:
computer
.
getAllocationScope
(),
allocation_scope
=
computer
.
getAllocationScope
(),
"follow_up_title"
:
context
.
getFollowUpTitle
(),
follow_up_title
=
context
.
getFollowUpTitle
(),
"message"
:
m
,
message
=
m
,
"created_at"
:
create_at
,
created_at
=
create_at
,
"since"
:
since
,
since
=
since
,
"age"
:
"%s m ago"
%
(
int
((
DateTime
()
-
DateTime
(
since
))
*
24
*
60
))}
))
age
=
"%s m ago"
%
(
int
((
DateTime
()
-
DateTime
(
since
))
*
24
*
60
))
))
else
:
else
:
message_list
.
append
(
newTempDocumen
t
(
message_list
.
append
(
Objec
t
(
document
,
instance
.
getRelativeUrl
(),
**
{
relative_url
=
instance
.
getRelativeUrl
(),
"uid"
:
instance
.
getUid
(),
uid
=
instance
.
getUid
(),
"title"
:
instance
.
getTitle
(),
title
=
instance
.
getTitle
(),
"specialise_title"
:
hosting_subscription
.
getTitle
(),
specialise_title
=
hosting_subscription
.
getTitle
(),
"software_release"
:
instance
.
getUrlString
(),
software_release
=
instance
.
getUrlString
(),
"follow_up_title"
:
context
.
getFollowUpTitle
(),
follow_up_title
=
context
.
getFollowUpTitle
(),
"computer_reference"
:
""
,
computer_reference
=
""
,
"allocation_scope"
:
""
,
allocation_scope
=
""
,
"message"
:
"Instance isn't allocated"
}
))
message
=
"Instance isn't allocated"
))
return
message_list
return
message_list
return
[]
return
[]
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