(self)
| 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 | |
| 144 | class FeatureImportListView(ListAPIView): # type: ignore[type-arg] |
nothing calls this directly
no test coverage detected