Commit 6bab850b authored by Sebastien Robin's avatar Sebastien Robin

do not use eval if it fails


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4874 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e3beb002
...@@ -498,7 +498,6 @@ class ListBoxWidget(Widget.Widget): ...@@ -498,7 +498,6 @@ class ListBoxWidget(Widget.Widget):
# First, grasp and intialize the variables we may need later # First, grasp and intialize the variables we may need later
# #
############################################################### ###############################################################
here = REQUEST['here'] here = REQUEST['here']
reset = REQUEST.get('reset', 0) reset = REQUEST.get('reset', 0)
form = field.aq_parent form = field.aq_parent
...@@ -687,7 +686,12 @@ class ListBoxWidget(Widget.Widget): ...@@ -687,7 +686,12 @@ class ListBoxWidget(Widget.Widget):
if REQUEST.form.has_key(k): if REQUEST.form.has_key(k):
params[k] = REQUEST.form[k] params[k] = REQUEST.form[k]
elif not params.has_key(k): elif not params.has_key(k):
params[k] = eval(v) # Probalby eval must be removed, we have tales
# expressions instead
try:
params[k] = eval(v)
except TypeError:
params[k] = v
# Allow overriding list_method, count_method and stat_method by params # Allow overriding list_method, count_method and stat_method by params
if params.has_key('list_method_id'): if params.has_key('list_method_id'):
...@@ -1963,7 +1967,7 @@ onChange="submitAction(this.form,'%s/portal_selections/setDomainRoot')"> ...@@ -1963,7 +1967,7 @@ onChange="submitAction(this.form,'%s/portal_selections/setDomainRoot')">
<!-- End of Table Wrapping for Select Tree --> <!-- End of Table Wrapping for Select Tree -->
</td></tr> </td></tr>
</table>""" % (select_tree_html,list_html) </table>""" % (select_tree_html,list_html)
LOG('Listbox render end call', 0, '')
return list_html return list_html
ListBoxWidgetInstance = ListBoxWidget() ListBoxWidgetInstance = ListBoxWidget()
......
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