Description
The list of fields seems to be empty when I am trying to write the created deck as a package. This happens when genanki tries to check for the sort field.
Traceback (most recent call last):
File "factory.py", line 98, in <module>
genanki.Package(DECK).write_to_file('output.apkg')
File "/Users/truvaking/miniconda3/lib/python3.7/site-packages/genanki/package.py", line 40, in write_to_file
self.write_to_db(cursor, timestamp, id_gen)
File "/Users/truvaking/miniconda3/lib/python3.7/site-packages/genanki/package.py", line 60, in write_to_db
deck.write_to_db(cursor, timestamp, id_gen)
File "/Users/truvaking/miniconda3/lib/python3.7/site-packages/genanki/deck.py", line 67, in write_to_db
note.write_to_db(cursor, timestamp, self.deck_id, id_gen)
File "/Users/truvaking/miniconda3/lib/python3.7/site-packages/genanki/note.py", line 163, in write_to_db
self.sort_field, # sfld
File "/Users/truvaking/miniconda3/lib/python3.7/site-packages/genanki/note.py", line 67, in sort_field
return self._sort_field or self.fields[self.model.sort_field_index]
Description The list of fields seems to be empty when I am trying to write the created deck as a package. This happens when
genanki
tries to check for the sort field.To reproduce Please run my script to reproduce the error https://github.com/lthiet/anki_region_france
Expected behavior I expect a new file to be written and the fields to be populated
Actual behavior The file is not written and the fields do not seem to be populated
genanki version