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

Function get_multivariate_options

api/features/views.py:1122–1144  ·  view source on GitHub ↗
(request: Request, feature_id: int)

Source from the content-addressed store, hash-verified

1120)
1121@permission_classes([EnvironmentKeyPermissions])
1122def get_multivariate_options(request: Request, feature_id: int) -> Response:
1123 environment = request.environment
1124 feature = get_object_or_404(Feature, id=feature_id, project=environment.project)
1125 fs = (
1126 FeatureState.objects.get_live_feature_states(
1127 environment=environment,
1128 additional_filters=Q(
1129 identity__isnull=True,
1130 feature_segment__isnull=True,
1131 feature_id=feature.id,
1132 ),
1133 )
1134 .filter(feature__is_archived=False)
1135 .select_related("feature_state_value")
1136 .first()
1137 )
1138
1139 payload = {
1140 "feature_state": fs,
1141 "options": feature.multivariate_options.all(),
1142 }
1143 data = FeatureMVOptionsValuesResponseSerializer(payload).data
1144 return Response(data)
1145
1146
1147def organisation_has_got_feature(request, organisation): # type: ignore[no-untyped-def]

Callers

nothing calls this directly

Calls 3

allMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…