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

InvalidOperation exception on dashboard #716

Closed
rolandgeider opened this issue Jul 1, 2021 · 0 comments
Closed

InvalidOperation exception on dashboard #716

rolandgeider opened this issue Jul 1, 2021 · 0 comments
Assignees
Milestone

Comments

@rolandgeider
Copy link
Member

Just got this by mail. It's possible to crash the application when accessing the dashboard:

Traceback (most recent call last):
  File "/home/wger/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/home/wger/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/wger/venv/lib/python3.8/site-packages/sentry_sdk/integrations/django/views.py", line 67, in sentry_wrapped_callback
    return callback(request, *args, **kwargs)
  File "/home/wger/venv/lib/python3.8/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/home/wger/src/wger/core/views/misc.py", line 153, in dashboard
    template_data['nutritional_info'] = plan.get_nutritional_values()
  File "/home/wger/src/wger/nutrition/models.py", line 166, in get_nutritional_values
    result['per_kg'][key] = result['total'][key] / weight_entry.weight

Exception Type: InvalidOperation at /pt/dashboard
Exception Value: [<class 'decimal.DivisionUndefined'
@rolandgeider rolandgeider self-assigned this Jul 1, 2021
@rolandgeider rolandgeider added this to the 2.1 milestone Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant