Commit 3e33f7b8 authored by Jérome Perrin's avatar Jérome Perrin

enable preference in createPreferenceForUser

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35613 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6ec89c42
No related merge requests found
......@@ -58,12 +58,12 @@
raise Unauthorized(script.getId())\n
\n
portal = context.getPortalObject()\n
if portal.portal_membership.isAnonymousUser():\n
if not portal.Base_checkPermission(\'portal_preferences\', \'Add portal content\'):\n
return\n
\n
from Products.ERP5Type.Message import translateString\n
preference = portal.portal_preferences.createPreferenceForUser(\n
context.getReference())\n
context.getReference(), enable=True)\n
\n
preference.setTitle(translateString(\'Preference for ${name}\',\n
mapping=dict(name=context.getTitle())))\n
......@@ -73,8 +73,6 @@ for assignment in context.contentValues(portal_type=\'Assignment\'):\n
if group:\n
preference.setPreferredSectionCategory(group)\n
preference.setPreferredAccountingTransactionSectionCategory(group)\n
\n
preference.enable()\n
</string> </value>
</item>
<item>
......@@ -129,11 +127,11 @@ preference.enable()\n
<string>portal</string>
<string>Products.ERP5Type.Message</string>
<string>translateString</string>
<string>True</string>
<string>preference</string>
<string>dict</string>
<string>_getiter_</string>
<string>assignment</string>
<string>True</string>
<string>group</string>
</tuple>
</value>
......
751
\ No newline at end of file
754
\ 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