Commit e61a5651 authored by Rafael Monnerat's avatar Rafael Monnerat

Added try/exception for ZeroDivisionError 



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16276 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fabfc15e
...@@ -1980,6 +1980,12 @@ class BasicGroup: ...@@ -1980,6 +1980,12 @@ class BasicGroup:
else: else:
info = None info = None
info = {} info = {}
info['info_center'] = ''
info['info_topright'] = ''
info['info_topleft'] = ''
info['info_botleft'] = ''
info['info_botright'] = ''
# getting info text from activity itself if exists # getting info text from activity itself if exists
info_center_method = getattr(activity_content,info_center,None) info_center_method = getattr(activity_content,info_center,None)
info_topright_method = getattr(activity_content,info_topright,None) info_topright_method = getattr(activity_content,info_topright,None)
...@@ -2001,12 +2007,7 @@ class BasicGroup: ...@@ -2001,12 +2007,7 @@ class BasicGroup:
info['info_botleft'] =str(info_botleft_method()) info['info_botleft'] =str(info_botleft_method())
if info_botright_method is not None: if info_botright_method is not None:
info['info_botright']=str(info_botright_method()) info['info_botright']=str(info_botright_method())
else:
info['info_center'] = ''
info['info_topright'] = ''
info['info_topleft'] = ''
info['info_botleft'] = ''
info['info_botright'] = ''
if info_tooltip_method is not None: if info_tooltip_method is not None:
info['info_tooltip']=str(info_tooltip_method()) info['info_tooltip']=str(info_tooltip_method())
...@@ -2355,9 +2356,9 @@ class PlanningStructure: ...@@ -2355,9 +2356,9 @@ class PlanningStructure:
position_secondary.absolute_end = 1 position_secondary.absolute_end = 1
position_secondary.absolute_range= 1 position_secondary.absolute_range= 1
for axis_group_element in self.secondary_axis.axis_group: for axis_group_element in self.secondary_axis.axis_group:
position_secondary = axis_group_element.position_secondary position_secondary = axis_group_element.position_secondary
try:
position_secondary.absolute_begin = ( position_secondary.absolute_begin = (
float(position_secondary.relative_begin) / float(position_secondary.relative_begin) /
self.secondary_axis.axis_size) self.secondary_axis.axis_size)
...@@ -2367,6 +2368,10 @@ class PlanningStructure: ...@@ -2367,6 +2368,10 @@ class PlanningStructure:
position_secondary.absolute_range = ( position_secondary.absolute_range = (
float(position_secondary.relative_range) / float(position_secondary.relative_range) /
self.secondary_axis.axis_size) self.secondary_axis.axis_size)
except ZeroDivisionError:
position_secondary.absolute_range = 1
position_secondary.absolute_end = 1
position_secondary.absolute_begin = 0
position_main = axis_group_element.position_main position_main = axis_group_element.position_main
position_main.absolute_begin = 0 position_main.absolute_begin = 0
position_main.absolute_end = 1 position_main.absolute_end = 1
......
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