Commit 57b07343 authored by Romain Courteaud's avatar Romain Courteaud

Handle non existing Selection.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22116 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a027cba6
...@@ -39,6 +39,7 @@ from Products.ERP5Type import PropertySheet ...@@ -39,6 +39,7 @@ from Products.ERP5Type import PropertySheet
from Form import ERP5Form from Form import ERP5Form
from Form import create_settings_form as Form_create_settings_form from Form import create_settings_form as Form_create_settings_form
from Selection import Selection
def create_settings_form(): def create_settings_form():
form = Form_create_settings_form() form = Form_create_settings_form()
...@@ -288,6 +289,10 @@ class ReportSection: ...@@ -288,6 +289,10 @@ class ReportSection:
if self.selection_report_list is not None: if self.selection_report_list is not None:
selection = portal_selections.getSelectionFor(selection_name, selection = portal_selections.getSelectionFor(selection_name,
REQUEST=REQUEST) REQUEST=REQUEST)
if selection is None:
selection = Selection()
portal_selections.setSelectionFor(selection_name, selection,
REQUEST=REQUEST)
self.saved_selections[selection_name]['report_list'] = \ self.saved_selections[selection_name]['report_list'] = \
selection.getReportList() selection.getReportList()
selection.edit(report_list=self.selection_report_list) selection.edit(report_list=self.selection_report_list)
......
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