Commit cbd2ab8e authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: fix Hosting Subscription migration

parent 7adf49d4
...@@ -136,19 +136,17 @@ def HostingSubscription_checkInstanceTreeMigrationConsistency(self, fixit=False) ...@@ -136,19 +136,17 @@ def HostingSubscription_checkInstanceTreeMigrationConsistency(self, fixit=False)
hosting_subscription_id = self.getId() hosting_subscription_id = self.getId()
hosting_subscription_relative_url = self.getRelativeUrl() hosting_subscription_relative_url = self.getRelativeUrl()
self.getParentValue()._delObject(hosting_subscription_id) container = aq_inner(self.getParentValue())
self = cloneDocumentWithANewPortalType(self, 'Instance Tree')
self.__class__ = klass container._delObject(hosting_subscription_id)
# self.upgradeObjectClass(returnTrue, 'erp5.portal_type.Hosting Subscription', 'erp5.portal_type.Instance Tree', returnTrue) portal.instance_tree_module._setOb(hosting_subscription_id, self)
self.portal_type = 'Instance Tree' instance_tree = portal.instance_tree_module.restrictedTraverse(hosting_subscription_id)
assert self.getPortalType() == 'Instance Tree'
if (getattr(self, 'workflow_history', None) is not None) and \ assert instance_tree.getPortalType() == 'Instance Tree'
('hosting_subscription_workflow' in self.workflow_history):
self.workflow_history['instance_tree_workflow'] = self.workflow_history.pop('hosting_subscription_workflow')
portal.instance_tree_module._setOb(hosting_subscription_id, aq_base(self)) if (getattr(instance_tree, 'workflow_history', None) is not None) and \
instance_tree = portal.instance_tree_module._getOb(hosting_subscription_id) ('hosting_subscription_workflow' in instance_tree.workflow_history):
instance_tree.workflow_history['instance_tree_workflow'] = instance_tree.workflow_history.pop('hosting_subscription_workflow')
instance_tree.reindexObject() instance_tree.reindexObject()
# Migrate Predecessor/Successor if the instance wasn't migrated before. # Migrate Predecessor/Successor if the instance wasn't migrated before.
......
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