www.fgks.org   »   [go: up one dir, main page]

Skip to content

Commit

Permalink
Make the web UI / DocSaveHelper() dedupe using casefold()
Browse files Browse the repository at this point in the history
  • Loading branch information
scottbarnes committed Dec 21, 2023
1 parent 08e5e6c commit 4c81801
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openlibrary/plugins/upstream/addbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,9 +753,9 @@ def read_subject(subjects):
f = io.StringIO(subjects.replace('\r\n', ''))
dedup = set()
for s in next(csv.reader(f, dialect='excel', skipinitialspace=True)):
if s.lower() not in dedup:
if s.casefold() not in dedup:
yield s
dedup.add(s.lower())
dedup.add(s.casefold())

work.subjects = list(read_subject(work.get('subjects', '')))
work.subject_places = list(read_subject(work.get('subject_places', '')))
Expand Down

0 comments on commit 4c81801

Please sign in to comment.