π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
chore: remove service token endpoint which is unused (#8797)
sriram veeraghantaf3c7c057b449
diff --git a/apps/api/plane/app/urls/api.py b/apps/api/plane/app/urls/api.pyindex eedf18ccc3..145cfdd652 100644--- a/apps/api/plane/app/urls/api.py+++ b/apps/api/plane/app/urls/api.py@@ -3,7 +3,7 @@# See the LICENSE file for details.from django.urls import path-from plane.app.views import ApiTokenEndpoint, ServiceApiTokenEndpoint+from plane.app.views import ApiTokenEndpointurlpatterns = [# API Tokens@@ -17,10 +17,5 @@ urlpatterns = [ApiTokenEndpoint.as_view(),name="api-tokens-details",),- path(- "workspaces/<str:slug>/service-api-tokens/",- ServiceApiTokenEndpoint.as_view(),- name="service-api-tokens",- ),## End API Tokens]diff --git a/apps/api/plane/app/views/__init__.py b/apps/api/plane/app/views/__init__.pyindex baa6661b9c..84f7872ec8 100644--- a/apps/api/plane/app/views/__init__.py+++ b/apps/api/plane/app/views/__init__.py@@ -165,7 +165,7 @@ from .module.issue import ModuleIssueViewSetfrom .module.archive import ModuleArchiveUnarchiveEndpoint-from .api import ApiTokenEndpoint, ServiceApiTokenEndpoint+from .api import ApiTokenEndpointfrom .page.base import (PageViewSet,diff --git a/apps/api/plane/app/views/api.py b/apps/api/plane/app/views/api.pyindex f2abc1a2de..f3163c3314 100644--- a/apps/api/plane/app/views/api.py+++ b/apps/api/plane/app/views/api.py@@ -13,9 +13,8 @@ from rest_framework import status# Module importfrom .base import BaseAPIView-from plane.db.models import APIToken, Workspace+from plane.db.models import APITokenfrom plane.app.serializers import APITokenSerializer, APITokenReadSerializer-from plane.app.permissions import WorkspaceEntityPermissionclass ApiTokenEndpoint(BaseAPIView):@@ -61,28 +60,3 @@ class ApiTokenEndpoint(BaseAPIView):serializer.save()return Response(serializer.data, status=status.HTTP_200_OK)return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)---class ServiceApiTokenEndpoint(BaseAPIView):- permission_classes = [WorkspaceEntityPermission]-- def post(self, request: Request, slug: str) -> Response:- workspace = Workspace.objects.get(slug=slug)-- api_token = APIToken.objects.filter(workspace=workspace, is_service=True).first()-- if api_token:- return Response({"token": str(api_token.token)}, status=status.HTTP_200_OK)- else:- # Check the user type- user_type = 1 if request.user.is_bot else 0-- api_token = APIToken.objects.create(- label=str(uuid4().hex),- description="Service Token",- user=request.user,- workspace=workspace,- user_type=user_type,- is_service=True,- )- return Response({"token": str(api_token.token)}, status=status.HTTP_201_CREATED)