Commit 0a548c15 authored by Rafael Monnerat's avatar Rafael Monnerat

Minor improvements (and fixes)

See merge request nexedi/slapos.core!543
parents c7bd0719 e042a47c
Pipeline #28768 failed with stage
in 0 seconds
......@@ -17,7 +17,6 @@ event_kw = {
# Create event
event = portal.event_module.newContent(**event_kw)
event.plan()
event.start(send_mail=True, comment="Sent via Person_sendSlapOSPendingTicketNotification")
if batch_mode:
......
......@@ -6,7 +6,6 @@ if context.getSimulationState() == "invalidated":
if context.getPortalType() != "Support Request":
return "Not a Support Request"
now = DateTime()
portal = context.getPortalObject()
document = context.getAggregateValue()
......@@ -49,6 +48,8 @@ if aggregate_portal_type == "Compute Node":
break
if is_instance_stalled and len(instance_list):
if last_contact is None:
return "Process instance stalled"
return "Process instance stalled, last contact was %s" % last_contact
return "All OK, latest contact: %s " % last_contact
......
......@@ -9,4 +9,5 @@ return portal.portal_catalog(
category_public.getUid(),
category_personal.getUid()],
validation_state="validated",
sort_on=(("title", "ASC" ),)
)
......@@ -21,8 +21,9 @@ def isSoftwareTypeChanged(software_type):
current_software_type = context.getSourceReference()
if software_type in base_type and current_software_type in base_type:
return False
else:
return current_software_type != software_type
if software_type in [None, ""]:
return False
return current_software_type != software_type
if 'software_type' in request and isSoftwareTypeChanged(request['software_type']):
raise ValueError("Change Software Type is forbidden.")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment