Division by zero on move_lines_to_parent
The execution in prod failed on
Processing single page 1030d087-c17e-4d4b-b183-da7cf1f3da65
Traceback (most recent call last):
File "/usr/share/arkindex/manage.py", line 22, in <module>
File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 414, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 460, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.8/contextlib.py", line 75, in inner
return func(*args, **kwds)
File "/usr/share/arkindex/documents/management/commands/move_lines_to_parent.py", line 128, in handle
File "/usr/share/arkindex/documents/management/commands/move_lines_to_parent.py", line 128, in <listcomp>
File "/usr/share/arkindex/documents/management/commands/move_lines_to_parent.py", line 64, in is_overlapping_enough
ZeroDivisionError: float division by zero
Cover that case and add a global try/except to avoid crashing the whole workflow