(self)
| 146 | permission_classes = [FeatureImportListPermissions] |
| 147 | |
| 148 | def get_queryset(self) -> QuerySet[FeatureImport]: |
| 149 | if getattr(self, "swagger_fake_view", False): |
| 150 | return FeatureImport.objects.none() |
| 151 | |
| 152 | environment_ids = [] |
| 153 | user = self.request.user |
| 154 | |
| 155 | for environment in Environment.objects.filter( |
| 156 | project_id=self.kwargs["project_pk"], |
| 157 | ): |
| 158 | if user.is_environment_admin(environment): # type: ignore[union-attr] |
| 159 | environment_ids.append(environment.id) |
| 160 | |
| 161 | return ( |
| 162 | FeatureImport.objects.filter(environment__in=environment_ids) |
| 163 | .defer("data") |
| 164 | .order_by("-created_at") |
| 165 | ) |
nothing calls this directly
no test coverage detected