From f3c0d48bb9c503ec4bb23d4689e9f783e1d9615a Mon Sep 17 00:00:00 2001 From: ducica Date: Mon, 20 Jan 2025 08:09:27 +0100 Subject: [PATCH] raising error if no community in payload --- oarepo_communities/requests/migration.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oarepo_communities/requests/migration.py b/oarepo_communities/requests/migration.py index 78ebd94..7473035 100644 --- a/oarepo_communities/requests/migration.py +++ b/oarepo_communities/requests/migration.py @@ -61,8 +61,10 @@ def apply(self, identity, request_type, topic, uow, *args, **kwargs): # coordination along multiple submission like requests? can only one be available at time? # ie. # and what if the community is deleted before the request is processed? - # community_id, _ = self.request.receiver.resolve().entities[0]._parse_ref_dict() + community_id = self.request.get("payload", {}).get("community", None) + if not community_id: + raise TargetCommunityNotProvidedException("Target community not provided.") service = get_record_service_for_record(topic) community_inclusion_service = (