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
...@@ -58,12 +58,12 @@ ...@@ -58,12 +58,12 @@
raise Unauthorized(script.getId())\n raise Unauthorized(script.getId())\n
\n \n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
if portal.portal_membership.isAnonymousUser():\n if not portal.Base_checkPermission(\'portal_preferences\', \'Add portal content\'):\n
return\n return\n
\n \n
from Products.ERP5Type.Message import translateString\n from Products.ERP5Type.Message import translateString\n
preference = portal.portal_preferences.createPreferenceForUser(\n preference = portal.portal_preferences.createPreferenceForUser(\n
context.getReference())\n context.getReference(), enable=True)\n
\n \n
preference.setTitle(translateString(\'Preference for ${name}\',\n preference.setTitle(translateString(\'Preference for ${name}\',\n
mapping=dict(name=context.getTitle())))\n mapping=dict(name=context.getTitle())))\n
...@@ -73,8 +73,6 @@ for assignment in context.contentValues(portal_type=\'Assignment\'):\n ...@@ -73,8 +73,6 @@ for assignment in context.contentValues(portal_type=\'Assignment\'):\n
if group:\n if group:\n
preference.setPreferredSectionCategory(group)\n preference.setPreferredSectionCategory(group)\n
preference.setPreferredAccountingTransactionSectionCategory(group)\n preference.setPreferredAccountingTransactionSectionCategory(group)\n
\n
preference.enable()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -129,11 +127,11 @@ preference.enable()\n ...@@ -129,11 +127,11 @@ preference.enable()\n
<string>portal</string> <string>portal</string>
<string>Products.ERP5Type.Message</string> <string>Products.ERP5Type.Message</string>
<string>translateString</string> <string>translateString</string>
<string>True</string>
<string>preference</string> <string>preference</string>
<string>dict</string> <string>dict</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>assignment</string> <string>assignment</string>
<string>True</string>
<string>group</string> <string>group</string>
</tuple> </tuple>
</value> </value>
......
751 754
\ 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