Skip to content

Commit

Permalink
Don't show update panos on swagger (#593)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillNilges authored Sep 22, 2024
1 parent e9e51b0 commit a30c354
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions src/meshapi/views/panoramas.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from typing import Union

import requests
from drf_spectacular.utils import OpenApiResponse, extend_schema, extend_schema_view, inline_serializer
from rest_framework import serializers, status
from drf_spectacular.utils import extend_schema
from rest_framework import status
from rest_framework.decorators import api_view, permission_classes
from rest_framework.request import Request
from rest_framework.response import Response
Expand All @@ -17,7 +17,6 @@
from meshapi.permissions import HasPanoramaUpdatePermission
from meshapi.util.constants import DEFAULT_EXTERNAL_API_TIMEOUT_SECONDS
from meshapi.util.django_pglocks import advisory_lock
from meshapi.views import form_err_response_schema

# Config for gathering/generating panorama links
PANO_REPO_OWNER = "nycmeshnet"
Expand Down Expand Up @@ -118,27 +117,7 @@ class GitHubError(Exception):


# View called to make MeshDB refresh the panoramas.
@extend_schema_view(
post=extend_schema(
tags=["Panoramas"],
responses={
"200": OpenApiResponse(
inline_serializer(
"UpdatePanoramasSuccessResponse",
fields={
"detail": serializers.CharField(),
"saved": serializers.IntegerField(),
"warnings": serializers.IntegerField(),
"warn_install_nums": serializers.ListField(child=serializers.CharField()),
},
),
description="Request received, an install has been created (along with member and "
"building objects if necessary).",
),
"500": OpenApiResponse(form_err_response_schema, description="Unexpected internal error"),
},
)
)
@extend_schema(exclude=True) # Don't show on docs page
@api_view(["POST"])
@permission_classes([HasPanoramaUpdatePermission])
def update_panoramas(request: Request) -> Response:
Expand Down

0 comments on commit a30c354

Please sign in to comment.