Skip to content

Commit

Permalink
Code formatting / variable renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewelwell committed Oct 16, 2024
1 parent 632884f commit 4366e68
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions api/segments/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,18 @@ def associated_features(self, request, *args, **kwargs):
query_serializer = AssociatedFeaturesQuerySerializer(data=request.query_params)
query_serializer.is_valid(raise_exception=True)

query_kwargs = {"feature_segment__segment": segment}

filter_kwargs = {"feature_segment__segment": segment}
if environment_id := query_serializer.validated_data.get("environment"):
environment = Environment.objects.get(pk=environment_id)
query_kwargs["environment"] = environment
filter_kwargs["environment"] = environment
if environment.use_v2_feature_versioning and (
latest_version_uuids := EnvironmentFeatureVersion.objects.get_latest_versions_by_environment_id(
environment_id
)
):
query_kwargs["environment_feature_version__in"] = latest_version_uuids
filter_kwargs["environment_feature_version__in"] = latest_version_uuids

queryset = FeatureState.objects.filter(**query_kwargs)
queryset = FeatureState.objects.filter(**filter_kwargs)

page = self.paginate_queryset(queryset)
if page is not None:
Expand Down

0 comments on commit 4366e68

Please sign in to comment.