diff --git a/openslides_backend/migrations/migrations/0045_fix_amendment_paragraph.py b/openslides_backend/migrations/migrations/0045_fix_amendment_paragraph.py index 326b2ec98..e0dc64c23 100644 --- a/openslides_backend/migrations/migrations/0045_fix_amendment_paragraph.py +++ b/openslides_backend/migrations/migrations/0045_fix_amendment_paragraph.py @@ -25,8 +25,7 @@ def migrate_models(self) -> Optional[List[BaseRequestEvent]]: for replacement in model.get(self.old_field, []): structured_field = self.old_field.replace("$", f"${replacement}") update[structured_field] = None - if structured_value := model.get(structured_field): - update[self.new_field][replacement] = structured_value + update[self.new_field][replacement] = model.get(structured_field) events.append( RequestUpdateEvent( fqid_from_collection_and_id("motion", id), update diff --git a/tests/system/migrations/test_0045_fix_amendment_paragraph.py b/tests/system/migrations/test_0045_fix_amendment_paragraph.py index 7d6be6ee1..87250cd5e 100644 --- a/tests/system/migrations/test_0045_fix_amendment_paragraph.py +++ b/tests/system/migrations/test_0045_fix_amendment_paragraph.py @@ -7,8 +7,8 @@ def test_migration(write, finalize, assert_model): "id": 61, "amendment_paragraph_$": ["0", "1", "2", "42"], "amendment_paragraph_$0": "change", - "amendment_paragraph_$1": "change", - "amendment_paragraph_$2": "change", + "amendment_paragraph_$1": "", + "amendment_paragraph_$2": "", "amendment_paragraph_$42": "change", }, }, @@ -29,8 +29,8 @@ def test_migration(write, finalize, assert_model): "id": 61, "amendment_paragraphs": { "0": "change", - "1": "change", - "2": "change", + "1": "", + "2": "", "42": "change", }, },