Commit 9c8cafc6 authored by Romain Courteaud's avatar Romain Courteaud

Automatically approve Computer registration.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42505 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e83b63a6
...@@ -54,16 +54,23 @@ ...@@ -54,16 +54,23 @@
\n \n
computer_portal_type = "Computer"\n computer_portal_type = "Computer"\n
\n \n
certificate_dict = context.getPortalObject().portal_certificate_authority.getNewCertificate()\n reference = "COMP-%s" % portal.portal_ids.generateNewId(\n
id_group=\'slap_computer_reference\',\n
id_generator=\'uid\')\n
\n
certificate_dict = context.getPortalObject().portal_certificate_authority.getNewCertificate(reference)\n
\n \n
module = portal.getDefaultModule(portal_type=computer_portal_type)\n module = portal.getDefaultModule(portal_type=computer_portal_type)\n
computer = module.newContent(\n computer = module.newContent(\n
portal_type=computer_portal_type,\n portal_type=computer_portal_type,\n
title=title,\n title=title,\n
reference=certificate_dict["id"],\n reference=reference,\n
destination_reference=certificate_dict["id"],\n
)\n )\n
\n \n
computer.requestComputerRegistration()\n computer.requestComputerRegistration()\n
computer.approveComputerRegistration()\n
\n
computer = context.restrictedTraverse(computer.getRelativeUrl())\n computer = context.restrictedTraverse(computer.getRelativeUrl())\n
\n \n
context.REQUEST.set("computer_certificate", certificate_dict["certificate"])\n context.REQUEST.set("computer_certificate", certificate_dict["certificate"])\n
...@@ -114,6 +121,7 @@ return computer.Computer_viewConnectionInformationAsWeb()\n ...@@ -114,6 +121,7 @@ return computer.Computer_viewConnectionInformationAsWeb()\n
<string>context</string> <string>context</string>
<string>portal</string> <string>portal</string>
<string>computer_portal_type</string> <string>computer_portal_type</string>
<string>reference</string>
<string>certificate_dict</string> <string>certificate_dict</string>
<string>module</string> <string>module</string>
<string>_getitem_</string> <string>_getitem_</string>
......
258 260
\ No newline at end of file \ No newline at end of file
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