MCPcopy Create free account
hub / github.com/Flagsmith/flagsmith / add_group_owners

Method add_group_owners

api/features/views.py:408–423  ·  view source on GitHub ↗
(self, request, *args, **kwargs)

Source from the content-addressed store, hash-verified

406 )
407 @action(detail=True, methods=["POST"], url_path="add-group-owners")
408 def add_group_owners(self, request, *args, **kwargs): # type: ignore[no-untyped-def]
409 feature = self.get_object()
410 data = request.data
411
412 serializer = FeatureGroupOwnerInputSerializer(data=data)
413 serializer.is_valid(raise_exception=True)
414
415 if not UserPermissionGroup.objects.filter(
416 id__in=serializer.validated_data["group_ids"],
417 organisation_id=feature.project.organisation_id,
418 ).count() == len(serializer.validated_data["group_ids"]):
419 raise serializers.ValidationError("Some groups not found")
420
421 serializer.add_group_owners(feature)
422 response = Response(self.get_serializer(instance=feature).data)
423 return response
424
425 @extend_schema(
426 request=FeatureGroupOwnerInputSerializer,

Callers

nothing calls this directly

Calls 4

add_group_ownersMethod · 0.95
is_validMethod · 0.80
get_objectMethod · 0.45

Tested by

no test coverage detected