1
0
Fork 0
mirror of https://github.com/qurator-spk/modstool.git synced 2025-08-14 03:59:53 +02:00

🧹 MODS: Only add type='text' if there is no type attribute

This commit is contained in:
Gerber, Mike 2025-08-08 12:36:25 +02:00
parent b9190a3695
commit 0928caa9d6

View file

@ -201,9 +201,10 @@ class TagGroup:
def add_missing_type_text(self) -> TagGroup:
for e in self.group:
if not e.attrib.get("type") == "text":
# Default to type=text
if not "type" in e.attrib:
e.attrib["type"] = "text"
warnings.warn("Added type='text'")
warnings.warn("Added placeTerm type='text'")
return self
def remove_attributes(self, attribs) -> TagGroup: