Skip to content

Commit

Permalink
fix(csv upload): check for the index name as primary title, and if no…
Browse files Browse the repository at this point in the history
…t exist raise Error with a clear message (previously it would have fall without message, or do wierd things).
  • Loading branch information
YishaiGlasner committed Oct 27, 2024
1 parent 26441e8 commit 1809e96
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sefaria/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,11 @@ def _import_versions_from_csv(rows, columns, user_id):
from sefaria.tracker import modify_bulk_text

index_title = rows[0][columns[0]] # assume the same index title for all
index_node = Ref(index_title).index_node
index = Index().load({'title': index_title})
if index:
index_node = index.nodes
else:
raise InputError(f'No book with primary title "{index_title}"')


action = "edit"
Expand Down

0 comments on commit 1809e96

Please sign in to comment.