Don't store importer errors in the database#1886
Don't store importer errors in the database#1886RickMohr merged 1 commit intoOpenTreeMap:masterfrom RickMohr:no-error-msgs-in-db
Conversation
|
(pulled down the branch and did some grepping) With this change, It was probably always a good idea for this mutation logic to be factored into a model method, but it makes even more sense now. Consider factoring this out to a model method like |
opentreemap/importer/errors.py
Outdated
There was a problem hiding this comment.
I did try that, and thought it hurt readability. So I'm leaving it even though _e is more correct.
|
On initial review, this looks like a nice, clean way to handle this. I'll +1 after I run the branch and look at some db rows. |
|
@steventlamb, other suggestions addressed. |
|
+1 I tested that this is reading and writing error messages correctly. This is as expected for new records. For existing records, I took a tree import row with errors on three fields that was already in my database, it had |
* Create table of error messages by error code * `append_error` saves only error code, not error message * Add `errors_by_array_with_messages` for situations where messages are needed * Fix a few tests * No data migration needed because error fields are accessed by name, not position
Don't store importer errors in the database
append_errorsaves only error code, not error messageerrors_by_array_with_messagesfor situations where messages are needed