(self, request, *args, **kwargs)
| 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, |
nothing calls this directly
no test coverage detected