Commit 6f2ea57c authored by Rafael Monnerat's avatar Rafael Monnerat

Simplify and reduce code.

parent 6433544c
...@@ -408,9 +408,10 @@ class ConfiguratorTool(BaseTool): ...@@ -408,9 +408,10 @@ class ConfiguratorTool(BaseTool):
security.declareProtected(Permissions.ModifyPortalContent, 'startInstallation') security.declareProtected(Permissions.ModifyPortalContent, 'startInstallation')
def startInstallation(self, business_configuration, REQUEST): def startInstallation(self, business_configuration, REQUEST):
""" Start installation process as an activity which will query generation """ Start installation process as an activity which will
server and download/install bt5 template files and meanwhile offer download/install bt5 template files and meanwhile offer
user a nice GUI to observe what's happening. """ user a nice GUI to observe what's happening. """
global installation_status global installation_status
# init installation status # init installation status
bt5_file_list = len(business_configuration.contentValues( bt5_file_list = len(business_configuration.contentValues(
...@@ -420,19 +421,7 @@ class ConfiguratorTool(BaseTool): ...@@ -420,19 +421,7 @@ class ConfiguratorTool(BaseTool):
installation_status['activity_list'] = [] installation_status['activity_list'] = []
active_process = self.portal_activities.newActiveProcess() active_process = self.portal_activities.newActiveProcess()
REQUEST.set('active_process_id', active_process.getId()) REQUEST.set('active_process_id', active_process.getId())
self.activate(active_process=active_process, tag='initialERP5Setup' business_configuration.activate(
).initialERP5Setup(business_configuration.getRelativeUrl(), request_restore_dict) active_process=active_process, tag='initialERP5Setup'
).build()
return self.ConfiguratorTool_viewInstallationStatus(REQUEST) return self.ConfiguratorTool_viewInstallationStatus(REQUEST)
security.declareProtected(Permissions.ModifyPortalContent,
'initialERP5Setup')
def initialERP5Setup(self, business_configuration, request_restore_dict={}):
""" Get from remote generation server customized bt5 template files
and then install them. """
# restore some REQUEST variables as this method is executed in an activity
# and there's no access to real original REQUEST
for key, value in request_restore_dict.items():
self.REQUEST.set(key, value)
bc = self.restrictedTraverse(business_configuration)
bc.build()
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