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

Method get_queryset

api/features/import_export/views.py:124–141  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

122 permission_classes = [FeatureExportListPermissions]
123
124 def get_queryset(self) -> QuerySet[FeatureExport]:
125 if getattr(self, "swagger_fake_view", False):
126 return FeatureExport.objects.none()
127
128 environment_ids = []
129 user = self.request.user
130
131 for environment in Environment.objects.filter(
132 project_id=self.kwargs["project_pk"],
133 ):
134 if user.is_environment_admin(environment): # type: ignore[union-attr]
135 environment_ids.append(environment.id)
136
137 return (
138 FeatureExport.objects.filter(environment__in=environment_ids)
139 .defer("data")
140 .order_by("-created_at")
141 )
142
143
144class FeatureImportListView(ListAPIView): # type: ignore[type-arg]

Callers

nothing calls this directly

Calls 2

is_environment_adminMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected