From db79960ba168724388737015b1801847607d423b Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 7 Apr 2022 16:22:41 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Force=20singleton=20for=20shelfLoca?= =?UTF-8?q?tor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Very few input sources contain multiple mods:shelfLocator elements for a mods:Location (illegal according to DFG MODS Anwendungsprofil). Force a singleton in this case. Fixes gh-7. --- qurator/modstool/modstool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qurator/modstool/modstool.py b/qurator/modstool/modstool.py index e469146..a4fed55 100755 --- a/qurator/modstool/modstool.py +++ b/qurator/modstool/modstool.py @@ -233,7 +233,7 @@ def mods_to_dict(mods, raise_errors=True): return shelf_locator.get('displayLabel') is None value['shelfLocator'] = TagGroup(tag, group) \ .filter(no_display_label) \ - .is_singleton() \ + .force_singleton() \ .has_no_attributes() \ .text() elif tag == '{http://www.loc.gov/mods/v3}originInfo':