denshoproject / ddr-cmdln

Command-line tools for automating the Densho Digital Repository's various processes.
Other
0 stars 2 forks source link

ddr-import accepts csv with null "status" for entity import #79

Closed GeoffFroh closed 6 years ago

GeoffFroh commented 6 years ago

ddr-import allows an entity model import csv where the status attribute is empty. status is a required field.

gjost commented 6 years ago

Before I can get to this specific problem I'm updating DDR.batch to work with the vocab-related tools that the rest of the codebase uses.

gjost commented 6 years ago

Just wondering, have you guys tried running ddr-import check? This should catch missing required values.

$ ddr-import check /tmp/ddr-testing-4076-entity-edited.csv /var/www/media/ddr/ddr-testing-40076 -U gjost -P REDACTED
...
2018-07-03 13:47:44,953 INFO     Validating headers
2018-07-03 13:47:44,954 INFO     ok
2018-07-03 13:47:44,954 INFO     Validating rows
2018-07-03 13:47:44,959 ERROR    Missing required fields
2018-07-03 13:47:44,959 ERROR    * row 0: ddr-testing-40076-1 ['status']
2018-07-03 13:47:44,960 ERROR    Invalid values
2018-07-03 13:47:44,960 ERROR    * row 0: ddr-testing-40076-1 [u'status']
2018-07-03 13:47:44,960 ERROR    FAIL
2018-07-03 13:47:44,960 ERROR    FAIL
...
2018-07-03 13:47:45,412 ERROR    TESTS FAILED--QUITTING!

Note I ran the above after fixing a few things that are not merged into master yet.

gjost commented 6 years ago

Fixed as of commit 94cd31e.