Commit 03a314cc authored by Tristan Cavelier's avatar Tristan Cavelier

erp5_knowledge_pad: ERP5Site_viewRandomPageGadget: prevent fail if no box is provided

(from Rafaels' changes)
parent b6bc402d
...@@ -79,7 +79,12 @@ if box_relative_url:\n ...@@ -79,7 +79,12 @@ if box_relative_url:\n
# Get the preferences (some casting of preferences would \n # Get the preferences (some casting of preferences would \n
# probably be a good thing here so that there is no need\n # probably be a good thing here so that there is no need\n
# to cas them later)\n # to cas them later)\n
preferences = box.KnowledgeBox_getDefaultPreferencesDict()\n # \n
# Prevent fail if no box is provided. \n
if box is not None:\n
preferences = box.KnowledgeBox_getDefaultPreferencesDict()\n
else:\n
preferences = {}\n
\n \n
if web_section_url is None:\n if web_section_url is None:\n
web_section_url = preferences.get(\'web_section_url\', \'\') # XXX-JPS - Why do we have to do casting ? (used to be str()\n web_section_url = preferences.get(\'web_section_url\', \'\') # XXX-JPS - Why do we have to do casting ? (used to be str()\n
......
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