Closed cblanken closed 1 week ago
Okay, it turns out this was just a few malformed lines in the input csv.
However I think it'd still be a good idea to add some error handling and relevant tests to prevent the user getting an unhelpful Internal Server Error
message like this.
One of the culprits seemed to be line 673 among others with a single field accidentally split into many comma-separated values.
German,dat,"→ Alternative form of das
→ Alternative form of das
→ it
→ Alternative form of dass
",,"kaikki-import,a,r,t,i,c,l,e,pron,pron,conj",IPA: /dat/ or /dɐt/ or /dət/
Note, the a,r,t,i,c,l,e
should be article
Right, I thought I'd handled all the bad cases but obviously not! Thank you for the ticket with the cause, this should be an easy test case case and fix.
This may have been due to the duplication of pron
in the list of tags ... I just added a simple test with a file like below
language,translation,term,parent,status,tags,pronunciation
Spanish,cat,gato,,1,"animal,animal",GAH-toh
and it's failing with same error. Working on that now, thanks.
Also added check for too many or few fields in the data, which the code wasn't handling correctly. :-P Whoops. Thanks.
Fixed in develop
, will be in next launch.
Launched in 3.5.2
Description Importing terms with the attached
.csv
file causes anIntegrityError
. See import.csvHere is a stack trace of the error. There error occurs as of commit 2b2911ea869822468ff7fce9e38fd742796ff0a4 on the develop branch.
To Reproduce The error can be reproduced by importing the terms on the default install.
Extra software info, if not already included in the Description: