diff --git a/apiserver/plane/api/views/base.py b/apiserver/plane/api/views/base.py index 305e1a1b6..0cf5e8731 100644 --- a/apiserver/plane/api/views/base.py +++ b/apiserver/plane/api/views/base.py @@ -1,5 +1,4 @@ # Python imports -import logging from urllib.parse import urlparse import zoneinfo diff --git a/apiserver/plane/app/views/cycle/base.py b/apiserver/plane/app/views/cycle/base.py index e777a93a6..5a57ebef2 100644 --- a/apiserver/plane/app/views/cycle/base.py +++ b/apiserver/plane/app/views/cycle/base.py @@ -15,10 +15,7 @@ from django.db.models import ( Value, CharField, ) -from django.core import serializers from django.utils import timezone -from django.utils.decorators import method_decorator -from django.views.decorators.gzip import gzip_page from django.contrib.postgres.aggregates import ArrayAgg from django.contrib.postgres.fields import ArrayField from django.db.models import UUIDField @@ -32,9 +29,7 @@ from rest_framework import status from .. import BaseViewSet, BaseAPIView, WebhookMixin from plane.app.serializers import ( CycleSerializer, - CycleIssueSerializer, CycleFavoriteSerializer, - IssueSerializer, CycleWriteSerializer, CycleUserPropertiesSerializer, ) @@ -48,13 +43,10 @@ from plane.db.models import ( CycleIssue, Issue, CycleFavorite, - IssueLink, - IssueAttachment, Label, CycleUserProperties, ) from plane.bgtasks.issue_activites_task import issue_activity -from plane.utils.issue_filters import issue_filters from plane.utils.analytics_plot import burndown_plot diff --git a/apiserver/plane/app/views/dashboard/base.py b/apiserver/plane/app/views/dashboard/base.py index 27e45f59c..e6757faf9 100644 --- a/apiserver/plane/app/views/dashboard/base.py +++ b/apiserver/plane/app/views/dashboard/base.py @@ -38,7 +38,6 @@ from plane.db.models import ( IssueLink, IssueAttachment, IssueRelation, - IssueAssignee, User, ) from plane.app.serializers import ( diff --git a/apiserver/plane/app/views/issue/base.py b/apiserver/plane/app/views/issue/base.py index 63d4358b0..f1b4c7627 100644 --- a/apiserver/plane/app/views/issue/base.py +++ b/apiserver/plane/app/views/issue/base.py @@ -1,7 +1,5 @@ # Python imports import json -import random -from itertools import chain # Django imports from django.utils import timezone @@ -21,64 +19,38 @@ from django.db.models import ( from django.core.serializers.json import DjangoJSONEncoder from django.utils.decorators import method_decorator from django.views.decorators.gzip import gzip_page -from django.db import IntegrityError from django.contrib.postgres.aggregates import ArrayAgg from django.contrib.postgres.fields import ArrayField -from django.db.models import Value, UUIDField +from django.db.models import UUIDField from django.db.models.functions import Coalesce # Third Party imports from rest_framework.response import Response from rest_framework import status -from rest_framework.parsers import MultiPartParser, FormParser # Module imports from .. import BaseViewSet, BaseAPIView, WebhookMixin from plane.app.serializers import ( - IssueActivitySerializer, - IssueCommentSerializer, IssuePropertySerializer, IssueSerializer, IssueCreateSerializer, - LabelSerializer, - IssueFlatSerializer, - IssueLinkSerializer, - IssueLiteSerializer, - IssueAttachmentSerializer, - IssueSubscriberSerializer, - ProjectMemberLiteSerializer, - IssueReactionSerializer, - CommentReactionSerializer, - IssueRelationSerializer, - RelatedIssueSerializer, IssueDetailSerializer, ) from plane.app.permissions import ( ProjectEntityPermission, - WorkSpaceAdminPermission, - ProjectMemberPermission, ProjectLitePermission, ) from plane.db.models import ( Project, Issue, - IssueActivity, - IssueComment, IssueProperty, - Label, IssueLink, IssueAttachment, IssueSubscriber, - ProjectMember, IssueReaction, - CommentReaction, - IssueRelation, ) from plane.bgtasks.issue_activites_task import issue_activity -from plane.utils.grouper import group_results from plane.utils.issue_filters import issue_filters -from collections import defaultdict -from plane.utils.cache import invalidate_cache class IssueListEndpoint(BaseAPIView): diff --git a/apiserver/plane/app/views/project/base.py b/apiserver/plane/app/views/project/base.py index 74d4e3466..5dbc99a27 100644 --- a/apiserver/plane/app/views/project/base.py +++ b/apiserver/plane/app/views/project/base.py @@ -346,12 +346,12 @@ class ProjectViewSet(WebhookMixin, BaseViewSet): {"name": "The project name is already taken"}, status=status.HTTP_410_GONE, ) - except Workspace.DoesNotExist as e: + except Workspace.DoesNotExist: return Response( {"error": "Workspace does not exist"}, status=status.HTTP_404_NOT_FOUND, ) - except serializers.ValidationError as e: + except serializers.ValidationError: return Response( {"identifier": "The project identifier is already taken"}, status=status.HTTP_410_GONE, @@ -410,7 +410,7 @@ class ProjectViewSet(WebhookMixin, BaseViewSet): {"error": "Project does not exist"}, status=status.HTTP_404_NOT_FOUND, ) - except serializers.ValidationError as e: + except serializers.ValidationError: return Response( {"identifier": "The project identifier is already taken"}, status=status.HTTP_410_GONE, diff --git a/apiserver/plane/bgtasks/export_task.py b/apiserver/plane/bgtasks/export_task.py index e409a45aa..2e0d88994 100644 --- a/apiserver/plane/bgtasks/export_task.py +++ b/apiserver/plane/bgtasks/export_task.py @@ -2,7 +2,6 @@ import csv import io import json -import logging import zipfile import boto3 diff --git a/apiserver/plane/bgtasks/issue_activites_task.py b/apiserver/plane/bgtasks/issue_activites_task.py index bdc75bd74..9a4e57a49 100644 --- a/apiserver/plane/bgtasks/issue_activites_task.py +++ b/apiserver/plane/bgtasks/issue_activites_task.py @@ -1,6 +1,5 @@ # Python imports import json -import logging import requests diff --git a/apiserver/plane/bgtasks/issue_automation_task.py b/apiserver/plane/bgtasks/issue_automation_task.py index 80ff43f4d..cdcdcd174 100644 --- a/apiserver/plane/bgtasks/issue_automation_task.py +++ b/apiserver/plane/bgtasks/issue_automation_task.py @@ -1,6 +1,5 @@ # Python imports import json -import logging from datetime import timedelta # Third party imports