Cadasta / cadasta-qgis-plugin

[DEPRECATED] QGIS plugin to create, edit, upload and download Cadasta projects
GNU General Public License v3.0
4 stars 7 forks source link

Fail gracefully on upload of layer #127

Closed wonderchook closed 7 years ago

wonderchook commented 7 years ago

If you upload a layer without the required fields

2017-04-18T14:38:35 1 Traceback (most recent call last): File "C:/Users/Admin/.qgis2/python/plugins\cadasta-qgis-plugin\cadasta\gui\tools\wizard\step_project_creation03.py", line 152, in processing_data self.upload_project() File "C:/Users/Admin/.qgis2/python/plugins\cadasta-qgis-plugin\cadasta\gui\tools\wizard\step_project_creation03.py", line 198, in upload_project self.upload_locations(upload_questionnaire_attribute) File "C:/Users/Admin/.qgis2/python/plugins\cadasta-qgis-plugin\cadasta\gui\tools\wizard\step_project_creation03.py", line 274, in upload_locations 'geometry': location['geometry'], KeyError: 'location_type'

cchristelis commented 7 years ago

Let's do a check and return a message Required field {{ field_name }} missing, please add before attempting again. @SteadyCadence, could you help us with some better text here...