Commit d227d8ac authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

TypeError can also happen in int().


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37256 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 568eb4f1
...@@ -377,7 +377,7 @@ class SelectionTool( BaseTool, SimpleItem ): ...@@ -377,7 +377,7 @@ class SelectionTool( BaseTool, SimpleItem ):
for uid in listbox_uid: for uid in listbox_uid:
try: try:
selection_uid_dict[int(uid)] = 1 selection_uid_dict[int(uid)] = 1
except ValueError: except (ValueError, TypeError):
selection_uid_dict[uid] = 1 selection_uid_dict[uid] = 1
self.setSelectionCheckedUidsFor(list_selection_name, selection_uid_dict.keys(), REQUEST=REQUEST) self.setSelectionCheckedUidsFor(list_selection_name, selection_uid_dict.keys(), REQUEST=REQUEST)
if REQUEST is not None: if REQUEST is not None:
...@@ -398,7 +398,7 @@ class SelectionTool( BaseTool, SimpleItem ): ...@@ -398,7 +398,7 @@ class SelectionTool( BaseTool, SimpleItem ):
for uid in listbox_uid: for uid in listbox_uid:
try: try:
if selection_uid_dict.has_key(int(uid)): del selection_uid_dict[int(uid)] if selection_uid_dict.has_key(int(uid)): del selection_uid_dict[int(uid)]
except ValueError: except (ValueError, TypeError):
if selection_uid_dict.has_key(uid): del selection_uid_dict[uid] if selection_uid_dict.has_key(uid): del selection_uid_dict[uid]
self.setSelectionCheckedUidsFor(list_selection_name, selection_uid_dict.keys(), REQUEST=REQUEST) self.setSelectionCheckedUidsFor(list_selection_name, selection_uid_dict.keys(), REQUEST=REQUEST)
if REQUEST is not None: if REQUEST is not None:
...@@ -757,7 +757,7 @@ class SelectionTool( BaseTool, SimpleItem ): ...@@ -757,7 +757,7 @@ class SelectionTool( BaseTool, SimpleItem ):
if form.has_key('page_start'): if form.has_key('page_start'):
try: try:
list_start = (int(form.pop('page_start', 0)) - 1) * lines list_start = (int(form.pop('page_start', 0)) - 1) * lines
except ValueError: except (ValueError, TypeError):
list_start = 0 list_start = 0
else: else:
list_start = int(form.pop('list_start', 0)) list_start = int(form.pop('list_start', 0))
...@@ -780,7 +780,7 @@ class SelectionTool( BaseTool, SimpleItem ): ...@@ -780,7 +780,7 @@ class SelectionTool( BaseTool, SimpleItem ):
if form.has_key('page_start'): if form.has_key('page_start'):
try: try:
list_start = (int(form.pop('page_start', 0)) - 1) * lines list_start = (int(form.pop('page_start', 0)) - 1) * lines
except ValueError: except (ValueError, TypeError):
list_start = 0 list_start = 0
else: else:
list_start = int(form.pop('list_start', 0)) list_start = int(form.pop('list_start', 0))
...@@ -803,7 +803,7 @@ class SelectionTool( BaseTool, SimpleItem ): ...@@ -803,7 +803,7 @@ class SelectionTool( BaseTool, SimpleItem ):
if form.has_key('page_start'): if form.has_key('page_start'):
try: try:
list_start = (int(form.pop('page_start', 0)) - 1) * lines list_start = (int(form.pop('page_start', 0)) - 1) * lines
except ValueError: except (ValueError, TypeError):
list_start = 0 list_start = 0
else: else:
list_start = int(form.pop('list_start', 0)) list_start = int(form.pop('list_start', 0))
......
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