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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.core
Commits
7d663881
Commit
7d663881
authored
Jul 11, 2017
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: Fix Tests to follow up recent changes
parent
72a3ddb3
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
228 additions
and
248 deletions
+228
-248
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequest_updateMonitoringHostingSubscriptionState.py
...upportRequest_updateMonitoringHostingSubscriptionState.py
+10
-10
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
+218
-238
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequest_updateMonitoringHostingSubscriptionState.py
View file @
7d663881
from
DateTime
import
DateTime
import
json
from
Products.ERP5Type.DateUtils
import
addToDate
portal
=
context
.
getPortalObject
()
document
=
context
.
getAggregateValue
()
...
...
@@ -10,6 +7,7 @@ if document is None:
return
has_error
=
False
software_instance
=
None
# Check if at least one software Instance is Allocated
for
instance
in
document
.
getSpecialiseRelatedValueList
(
...
...
@@ -20,6 +18,7 @@ for instance in document.getSpecialiseRelatedValueList(
if
instance
.
getAggregateValue
()
is
not
None
:
if
instance
.
getPortalType
()
==
"Software Instance"
and
\
instance
.
SoftwareInstance_hasReportedError
():
software_instance
=
instance
has_error
=
True
break
else
:
...
...
@@ -29,17 +28,18 @@ for instance in document.getSpecialiseRelatedValueList(
if
not
has_error
:
person
=
context
.
getDestinationDecision
(
portal_type
=
"Person"
)
if
not
person
:
return
return
message
=
instance
.
SoftwareInstance_hasReportedError
(
include_message
=
True
)
if
message
in
[
"Not possible to find the last message"
,
"#access instance available"
]:
# Do not change state in case of transitory states.
return
message
if
software_instance
is
not
None
:
message
=
software_instance
.
SoftwareInstance_hasReportedError
(
include_message
=
True
)
if
message
in
[
"Not possible to find the last message"
,
"#access instance available"
]:
# Do not change state in case of transitory states.
return
if
context
.
getSimulationState
()
==
"validated"
:
context
.
suspend
()
else
:
return
return
# Send Notification message
message
=
""" Suspending this ticket as the problem is not present anymore. """
...
...
@@ -53,6 +53,6 @@ if not has_error:
message
=
notification_message
.
asText
(
substitution_method_parameter_dict
=
{
'mapping_dict'
:
mapping_dict
})
return
context
.
SupportRequest_trySendNotificationMessage
(
"Suspending this ticket as the problem is not present anymore"
,
message
,
person
)
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
View file @
7d663881
This diff is collapsed.
Click to expand it.
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