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

Handle null multichoice value #3147

Merged

Conversation

jwalgran
Copy link
Contributor

@jwalgran jwalgran commented Jun 9, 2017

There is some data in the production database where the value of a multichoice field audit is the string "null". Adding a None check to the clean_value function prevents an exception where code further down in the function expects the value to be iterable.


Testing

/greenprintmaps/features/2081911/

The production data has an audit that looks like this

otm=# select field, previous_value, current_value  from treemap_audit where model = 'Tree' and model_id = 1814485 and previous_value = 'null' order by created;
        field         | previous_value | current_value
----------------------+----------------+---------------
 udf:Name of Project: | null           | null

On the develop branch, loading the detail page for this plot crashes. On the PR branch, it loads properly.


Connects to https://github.com/OpenTreeMap/otm-addons/issues/1526

There is some data in the production database where the value of a
multichoice field audit is the string "null". Adding a None check to
the `clean_value` function prevents an exception where code further
down in the function expects the value to be iterable.
@jwalgran jwalgran requested a review from maurizi June 9, 2017 22:52
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.003%) to 83.707% when pulling c3a8683 on jwalgran:jcw/handle-null-multichoice-value into 92495b7 on OpenTreeMap:develop.

@jwalgran
Copy link
Contributor Author

@azavea-bot rebuild

3 similar comments
@jwalgran
Copy link
Contributor Author

@azavea-bot rebuild

@jwalgran
Copy link
Contributor Author

@azavea-bot rebuild

@jwalgran
Copy link
Contributor Author

@azavea-bot rebuild

@jwalgran
Copy link
Contributor Author

(I am working through a problem with provisioning the PR builder VM)

@jwalgran jwalgran merged commit 01a460b into OpenTreeMap:develop Jun 15, 2017
@jwalgran jwalgran deleted the jcw/handle-null-multichoice-value branch June 15, 2017 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants