Commit be561584 authored by Ivan Tyagov's avatar Ivan Tyagov

Return consistent result no matter if user has or not enabled preference.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36441 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 47bd8005
......@@ -60,17 +60,17 @@ from Products.ERP5Type.Cache import CachingMethod\n
\n
portal = context.getPortalObject()\n
def getPreferredForumSignature(username):\n
result = {\'preferred_forum_signature\': None,\n
\'preferred_forum_quote_original_message\': False}\n
preference = portal.portal_catalog.getResultValue(\n
portal_type=\'Preference\',\n
owner = username,\n
preference_state=\'enabled\')\n
if preference is not None:\n
return {\'preferred_forum_signature\': preference.getProperty(\'preferred_forum_signature\', None),\n
\'preferred_forum_quote_original_message\': preference.getProperty(\'preferred_forum_quote_original_message\', False),\n
}\n
else:\n
return {}\n
\n
result[\'preferred_forum_signature\'] = preference.getProperty(\'preferred_forum_signature\', None)\n
result[\'preferred_forum_quote_original_message\'] = preference.getProperty(\'preferred_forum_quote_original_message\', False)\n
return result\n
\n
getPreferredForumSignature = CachingMethod(getPreferredForumSignature,\n
("ERP5Site_getUserPreferredForumSettingsDict", username),\n
cache_factory=\'erp5_ui_short\')\n
......
66
\ No newline at end of file
67
\ 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