Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Division by Zero error in member statistics #892

Open
Kurocon opened this issue Sep 11, 2024 · 0 comments
Open

Division by Zero error in member statistics #892

Kurocon opened this issue Sep 11, 2024 · 0 comments
Labels
bug Undesired and unintended behaviour in the website easy-to-fix These issues are easy to fix and recommended for newer members.

Comments

@Kurocon
Copy link
Member

Kurocon commented Sep 11, 2024

When a date in the future (or in the past where no member data exists) is selected, a ZeroDivisionError is thrown on the member statistics page.

percent_active_members = '{0:.2f}'.format((active_members_count*100.0)/members_count)

ZeroDivisionError:float division by zero
File "django/core/handlers/exception.py", line 47, in inner
     response = get_response(request)
File "django/core/handlers/base.py", line 181, in _get_response
     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "amelie/tools/decorators.py", line 33, in _do_test_request
     return view_func(request, *args, **kwargs)
File "amelie/members/views.py", line 128, in statistics
     percent_active_members = '{0:.2f}'.format((active_members_count*100.0)/members_count) 
@Kurocon Kurocon added bug Undesired and unintended behaviour in the website easy-to-fix These issues are easy to fix and recommended for newer members. labels Sep 11, 2024
@supertom01 supertom01 moved this from Backlog to Ready in WWW - Sprint board Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Undesired and unintended behaviour in the website easy-to-fix These issues are easy to fix and recommended for newer members.
Projects
Status: Ready
Development

No branches or pull requests

1 participant