Skip to content

Commit

Permalink
[Cherry-Pick] Fix migration 54 (OpenSlides#2630)
Browse files Browse the repository at this point in the history
  • Loading branch information
luisa-beerboom authored and peb-adr committed Sep 23, 2024
1 parent 8750005 commit 49cc4f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ def migrate_models(self) -> list[BaseRequestEvent] | None:
)
for id_, model in models.items():
if (
collection_from_fqid(fqid := model["content_object_id"])
model.get("content_object_id")
and collection_from_fqid(fqid := model["content_object_id"])
== "mediafile"
):
events.append(
Expand Down
5 changes: 5 additions & 0 deletions tests/system/migrations/test_0054_split_mediafile_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ def test_migration(write, finalize, assert_model):
"fqid": "projection/1",
"fields": {"id": 1, "meeting_id": 2, "content_object_id": "mediafile/5"},
},
{
"type": "create",
"fqid": "projection/2",
"fields": {"id": 2, "meeting_id": 2, "content_object_id": None},
},
{
"type": "create",
"fqid": "mediafile/6",
Expand Down

0 comments on commit 49cc4f3

Please sign in to comment.