From 95cef8b6b53245c90c0209326a722f86ccdf30fd Mon Sep 17 00:00:00 2001 From: Anika Churilova Date: Fri, 1 Nov 2024 14:28:01 +0100 Subject: [PATCH] serials importer: remove substrings only from the end of the title * closes https://github.com/CERNDocumentServer/cds-ils/issues/923 --- cds_ils/importer/series/importer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cds_ils/importer/series/importer.py b/cds_ils/importer/series/importer.py index d18706802..c0a79b03f 100644 --- a/cds_ils/importer/series/importer.py +++ b/cds_ils/importer/series/importer.py @@ -120,7 +120,8 @@ def _normalize_title(title): # will become # `international series of numerical mathematics` for substring in IGNORE_SUFFIXES: - t = rreplace(t, substring, "") + if re.search(substring + "$", t): + t = rreplace(t, substring, "") return t.strip() def update_series(self, matched_series, json_series):