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,18 +2356,22 @@ class PlanningStructure: ...@@ -2355,18 +2356,22 @@ 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
position_secondary.absolute_begin = ( try:
float(position_secondary.relative_begin) / position_secondary.absolute_begin = (
self.secondary_axis.axis_size) float(position_secondary.relative_begin) /
position_secondary.absolute_end = ( self.secondary_axis.axis_size)
float(position_secondary.relative_end) / position_secondary.absolute_end = (
self.secondary_axis.axis_size) float(position_secondary.relative_end) /
position_secondary.absolute_range = ( self.secondary_axis.axis_size)
float(position_secondary.relative_range) / position_secondary.absolute_range = (
self.secondary_axis.axis_size) float(position_secondary.relative_range) /
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