OpenTreeMap / otm-core

OpenTreeMap is a collaborative platform for crowdsourced tree inventory, ecosystem services calculations, urban forestry analysis, and community engagement.
www.opentreemap.org
Other
188 stars 87 forks source link

Return plot create/update validation errors with a 400 status #3202

Closed jwalgran closed 7 years ago

jwalgran commented 7 years ago

Previously, validation errors in the plot create and update views were not being caught, resulting in a 500 error being logged in Rollbar.

Updating these views to properly handle the validation errors required a fix to the transform_plot_update_dict function to check for the existence of a key before trying to read it from the plot dict.


Testing

Use a mobile app and attempt to both create and update a tree with zero diameter and verify that the API response has a 400 status code.


Connects to https://github.com/OpenTreeMap/otm-ios/issues/353

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.06%) to 83.852% when pulling 89a0c7b857fd224816bd126c45bf066c0fbbd685 on jwalgran:feature/return-api-validation-errors-as-400 into c655bdd2ec8d3f4dbc9452f421011b8ddde142f2 on OpenTreeMap:develop.