Commit bc7f212d authored by Romain Courteaud's avatar Romain Courteaud Committed by Jérome Perrin

erp5_configurator: prevent zerodivisionerror

After discussing on
!1103 (comment 104474) we
amended the original commit so that if there are no bt to install at
this point we consider this step is finished (use 1 and not 0)
parent ccd7b3f0
......@@ -13,7 +13,10 @@ is_bt5_installation_running = installation_status['bt5']['all']!=0 and \
if not is_bt5_building_running:
all_bt5s = float(installation_status['bt5']['all'])
current_bt5s = float(installation_status['bt5']['current'])
bt5_percent_of_total = current_bt5s / all_bt5s
if all_bt5s:
bt5_percent_of_total = current_bt5s / all_bt5s
else:
bt5_percent_of_total = 1
calc_percentage = calc_percentage + building_bt5_part_percentage + \
bt5_percent_of_total*installation_bt5_part_percentage
......
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