Skip to content

Commit

Permalink
raising error if no community in payload
Browse files Browse the repository at this point in the history
  • Loading branch information
Ducica committed Jan 20, 2025
1 parent 237ddf1 commit f3c0d48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion oarepo_communities/requests/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down

0 comments on commit f3c0d48

Please sign in to comment.