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

Fix dataview summary views' div by 0 error #126

Open
dgets opened this issue May 11, 2019 · 0 comments
Open

Fix dataview summary views' div by 0 error #126

dgets opened this issue May 11, 2019 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@dgets
Copy link
Owner

dgets commented May 11, 2019

If the usages listing for a particular substance in either of the dataview summary pages is 0 or 1 elements long, there is a divide by 0 error. Best way to handle this would probably be to test the lengths, and if there is a length of 0 or 1 for any of the lists, raise an error flag. This should be checked for in the view, to avoid trying to process that listing. It should also be passed to the template, and if the error flag exists there, that section of the table should not be rendered, or rendered with an appropriate message that the statistic is unavailable.

This is currently blocking #123, and has borked the dataview summary for individual substances, as well.

@dgets dgets added the bug Something isn't working label May 11, 2019
@dgets dgets added this to the full release milestone May 11, 2019
@dgets dgets self-assigned this May 11, 2019
dgets added a commit that referenced this issue May 11, 2019
…e that this has not fixed the error caused by only 1 listing in a usages list (#126).
dgets added a commit that referenced this issue May 11, 2019
…d tabulation only). Note that the template still displays superfluous table elements at this point.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant