IATI / IATI-Datastore

An open-source datastore for IATI data with RESTful web API providing XML, JSON, CSV plus ETL tools
http://datastore.iatistandard.org/
Other
1 stars 0 forks source link

Fix divide by zero errors in `iati crawl status` #298

Closed andylolz closed 6 years ago

andylolz commented 6 years ago

If Activity.query.count() is zero, you get a divide by zero error when running iati crawl status. This checks and avoids it.

NB try/except might be more pythonic here, but this does the trick. EDIT I’ve redone it with try/except.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 78.177% when pulling b364f3c0a64980206bba5e5325fe44f63158df83 on andylolz:divide-by-zero into 4f1dada1a1e864ce900d4fb7301c4e453081dbc7 on IATI:master.

allthatilk commented 6 years ago

@andylolz approving and merging what I can now but these changes don't get pulled to the dev Datastore until at least midweek as I temporarily don't have access to the servers