digitalfabrik / integreat-cms

Simplified content management back end for the Integreat App - a multilingual information platform for newcomers
https://digitalfabrik.github.io/integreat-cms/
Apache License 2.0
55 stars 33 forks source link

`ZeroDivisionError` in region dash board #2310

Closed MizukiTemma closed 1 year ago

MizukiTemma commented 1 year ago

Describe the Bug

ZeroDivisionError occurs when there is no page but HIX is activated in the region.

Steps to Reproduce

  1. Go to a region
  2. Archive all the pages
  3. Activate HIX for the region
  4. Go to the region dash board
  5. see the error

Expected Behavior

Dashboard will be shown.

Actual Behavior

ZeroDivisionError. Users cannot see the dashboard

Additional Information

Traceback File "/home/user/integreat-cms/integreat_cms/cms/views/dashboard/dashboard_view.py", line 85, in get_hix_context ready_for_mt = math.trunc(100 * ready_for_mt_count / len(hix_translations)) Exception Type: ZeroDivisionError at /nurnberg/ Exception Value: division by zero
MizukiTemma commented 1 year ago

This is related to #2296