Commit fb5c4b9b authored by Jérome Perrin's avatar Jérome Perrin

don't use deprecated portal_ids API and call setters instead of edit

Because edit adds a line in workflow_history
parent fc05b33b
......@@ -63,14 +63,12 @@ short_portal_type = type_definition.getShortTitle()\n
if not short_portal_type:\n
short_portal_type = \'\'.join(s for s in type_definition.getId() if s.isupper())\n
\n
id_group = (\'reference\', short_portal_type)\n
default = 1\n
new_id = portal.portal_ids.generateNewId(id_group=id_group, default=default)\n
new_id = portal.portal_ids.generateNewId(id_group=repr((\'reference\', short_portal_type)), default=1)\n
reference = \'%s-%s\' % (short_portal_type, new_id)\n
\n
# Set preferred text format and reference\n
context.edit(content_type=context.portal_preferences.getPreferredTextFormat(),\n
reference=reference)\n
context.setContentType(context.portal_preferences.getPreferredTextFormat())\n
context.setReference(reference)\n
</string> </value>
</item>
<item>
......
651
\ No newline at end of file
652
\ 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