Commit 6654869a authored by Łukasz Nowak's avatar Łukasz Nowak

Use workflow transition.

parent 12341a40
...@@ -51,35 +51,12 @@ ...@@ -51,35 +51,12 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>portal = context.getPortalObject()\n
\n person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
computer_portal_type = "Computer"\n request_kw = dict(computer_title=title)\n
\n person.requestComputer(**request_kw)\n
reference = "COMP-%s" % portal.portal_ids.generateNewId(\n computer = context.restrictedTraverse(context.REQUEST.get(\'computer\'))\n
id_group=\'slap_computer_reference\',\n
id_generator=\'uid\')\n
\n
certificate_dict = context.getPortalObject().portal_certificate_authority.getNewCertificate(reference)\n
\n
module = portal.getDefaultModule(portal_type=computer_portal_type)\n
computer = module.newContent(\n
portal_type=computer_portal_type,\n
title=title,\n
reference=reference,\n
destination_reference=certificate_dict["id"],\n
capacity_scope=\'open\',\n
)\n
\n
computer.requestComputerRegistration()\n
computer.approveComputerRegistration()\n
\n
computer = context.restrictedTraverse(computer.getRelativeUrl())\n
\n
context.REQUEST.set("computer_certificate", certificate_dict["certificate"])\n
context.REQUEST.set("computer_key", certificate_dict["key"])\n
context.REQUEST.set("computer_url", computer.absolute_url())\n
message = "Registering Computer"\n message = "Registering Computer"\n
context.REQUEST.set("portal_status_message", message)\n context.REQUEST.set("portal_status_message", message)\n
\n
return computer.Computer_viewConnectionInformationAsWeb()\n return computer.Computer_viewConnectionInformationAsWeb()\n
</string> </value> </string> </value>
</item> </item>
......
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