(request, organisation_pk: int)
| 245 | @permission_classes([IsAuthenticated, GithubIsAdminOrganisation]) |
| 246 | @github_api_call_error_handler(error="Failed to retrieve GitHub repositories.") |
| 247 | def fetch_repositories(request, organisation_pk: int) -> Response | None: # type: ignore[no-untyped-def] |
| 248 | query_serializer = PaginatedQueryParamsSerializer(data=request.query_params) |
| 249 | if not query_serializer.is_valid(): |
| 250 | return Response({"error": query_serializer.errors}, status=400) |
| 251 | installation_id = request.GET.get("installation_id") |
| 252 | |
| 253 | if not installation_id: |
| 254 | return Response( |
| 255 | data={"detail": "Missing installation_id parameter"}, |
| 256 | content_type="application/json", |
| 257 | status=status.HTTP_400_BAD_REQUEST, |
| 258 | ) |
| 259 | |
| 260 | data = fetch_github_repositories( |
| 261 | installation_id=installation_id, params=query_serializer.validated_data |
| 262 | ) |
| 263 | return Response( |
| 264 | data=data, |
| 265 | content_type="application/json", |
| 266 | status=status.HTTP_200_OK, |
| 267 | ) |
| 268 | |
| 269 | |
| 270 | @api_view(["GET"]) |
nothing calls this directly
no test coverage detected
searching dependent graphs…