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
186 stars 88 forks source link

Prevent leading/trailing blanks in UDF choice values #1823

Open RickMohr opened 9 years ago

RickMohr commented 9 years ago

This is more involved than trimming UDF names because choice definitions are buried in UDF objects' datatype JSON field and choice values are buried in Plot or Tree objects' udfs hstore.

The data migration:

The validator (udf._validate_single_datatype) must trim all choice values, and (if any changed) update datatype['choices'] and serialize and save datatype.

maurizi commented 9 years ago

Not as bad as it seems at first: We already wrote the code to update choice values https://github.com/OpenTreeMap/OTM2/blob/077be607964965fb4200e09d59acf3b046131724/opentreemap/treemap/udf.py#L319-L339

jwalgran commented 5 years ago

Related: https://rollbar.com/Azavea/OpenTreeMap/items/3837/

jwalgran commented 5 years ago

Related: https://rollbar.com/Azavea/OpenTreeMap/items/3838/