(request: Request, feature_id: int)
| 1120 | ) |
| 1121 | @permission_classes([EnvironmentKeyPermissions]) |
| 1122 | def 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 | |
| 1147 | def organisation_has_got_feature(request, organisation): # type: ignore[no-untyped-def] |
nothing calls this directly
no test coverage detected
searching dependent graphs…