Skip to content

Commit

Permalink
simplify caching logic
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewelwell committed Nov 18, 2024
1 parent 5a5e7e4 commit 80f6588
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions api/features/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ def get_queryset(self):
if environment_id:
page = self.paginate_queryset(queryset)
self.environment = Environment.objects.get(id=environment_id)
self.feature_ids = [feature.id for feature in page]
q = Q(
feature_id__in=[feature.id for feature in page],
feature_id__in=self.feature_ids,
identity__isnull=True,
feature_segment__isnull=True,
)
Expand Down Expand Up @@ -214,10 +215,9 @@ def get_serializer_context(self):
environment = get_object_or_404(
Environment, id=self.request.query_params["environment"]
)
queryset = self.get_queryset()
page = self.paginate_queryset(queryset)
feature_ids = [feature.id for feature in page]
context["overrides_data"] = get_overrides_data(environment, feature_ids)
context["overrides_data"] = get_overrides_data(
environment, self.feature_ids
)

return context

Expand Down

0 comments on commit 80f6588

Please sign in to comment.