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

Divide by zero error when Attribute that has_usage is 0 #336

Closed
payerle opened this issue Nov 10, 2021 · 1 comment
Closed

Divide by zero error when Attribute that has_usage is 0 #336

payerle opened this issue Nov 10, 2021 · 1 comment

Comments

@payerle
Copy link
Contributor

payerle commented Nov 10, 2021

If one has an AllocationAttribute of a type which has_usage and that attribute is set to 0, the allocation page will raise divide by zero exceptions. The web pages should not crash.

payerle added a commit to payerle/coldfront that referenced this issue Nov 10, 2021
…s_usage=True

This adds a try/except block in generate_guauge_data_from_usage() (why
the misspelling?) to catch for divide by zero errors.  If value=0, we
set the percent used to 100% (arbitrary, but better than an exception)
aebruno added a commit that referenced this issue Dec 23, 2021
Fix for #336 - Divide-by-zero error for Attrib value=0 and has_usage
@aebruno
Copy link
Member

aebruno commented Dec 23, 2021

Fixed in PR #337

@aebruno aebruno closed this as completed Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants