From 7c9a2b99e6856159b0b78af362928f2ff569333b Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Wed, 27 Mar 2024 18:05:39 +0530 Subject: [PATCH] dev: fix lint errors --- apiserver/plane/api/serializers/issue.py | 4 ++-- apiserver/plane/app/views/dashboard/base.py | 20 ------------------- apiserver/plane/app/views/issue/draft.py | 9 --------- apiserver/plane/app/views/module/issue.py | 2 +- .../plane/bgtasks/project_invitation_task.py | 2 -- 5 files changed, 3 insertions(+), 34 deletions(-) diff --git a/apiserver/plane/api/serializers/issue.py b/apiserver/plane/api/serializers/issue.py index c78b109ef..c40f56ccc 100644 --- a/apiserver/plane/api/serializers/issue.py +++ b/apiserver/plane/api/serializers/issue.py @@ -79,7 +79,7 @@ class IssueSerializer(BaseSerializer): parsed_str = html.tostring(parsed, encoding="unicode") data["description_html"] = parsed_str - except Exception as e: + except Exception: raise serializers.ValidationError("Invalid HTML passed") # Validate assignees are from project @@ -366,7 +366,7 @@ class IssueCommentSerializer(BaseSerializer): parsed_str = html.tostring(parsed, encoding="unicode") data["comment_html"] = parsed_str - except Exception as e: + except Exception: raise serializers.ValidationError("Invalid HTML passed") return data diff --git a/apiserver/plane/app/views/dashboard/base.py b/apiserver/plane/app/views/dashboard/base.py index ee8a69dac..e6051e609 100644 --- a/apiserver/plane/app/views/dashboard/base.py +++ b/apiserver/plane/app/views/dashboard/base.py @@ -48,26 +48,6 @@ from plane.utils.issue_filters import issue_filters # Module imports from .. import BaseAPIView -from plane.db.models import ( - Issue, - IssueActivity, - ProjectMember, - Widget, - DashboardWidget, - Dashboard, - Project, - IssueLink, - IssueAttachment, - IssueRelation, - User, -) -from plane.app.serializers import ( - IssueActivitySerializer, - IssueSerializer, - DashboardSerializer, - WidgetSerializer, -) -from plane.utils.issue_filters import issue_filters def dashboard_overview_stats(self, request, slug): diff --git a/apiserver/plane/app/views/issue/draft.py b/apiserver/plane/app/views/issue/draft.py index d4f9e01ea..1b9a1b441 100644 --- a/apiserver/plane/app/views/issue/draft.py +++ b/apiserver/plane/app/views/issue/draft.py @@ -1,24 +1,15 @@ # Python imports import json -from django.contrib.postgres.aggregates import ArrayAgg -from django.contrib.postgres.fields import ArrayField from django.core.serializers.json import DjangoJSONEncoder from django.db.models import ( - Case, - CharField, Exists, F, Func, - Max, OuterRef, Prefetch, Q, - UUIDField, - Value, - When, ) -from django.db.models.functions import Coalesce # Django imports from django.utils import timezone diff --git a/apiserver/plane/app/views/module/issue.py b/apiserver/plane/app/views/module/issue.py index c1ee65b9e..15e4efdd0 100644 --- a/apiserver/plane/app/views/module/issue.py +++ b/apiserver/plane/app/views/module/issue.py @@ -44,7 +44,7 @@ from plane.utils.paginator import ( ) # Module imports -from .. import BaseAPIView, BaseViewSet, WebhookMixin +from .. import BaseViewSet, WebhookMixin class ModuleIssueViewSet(WebhookMixin, BaseViewSet): diff --git a/apiserver/plane/bgtasks/project_invitation_task.py b/apiserver/plane/bgtasks/project_invitation_task.py index dea0f30a3..84ef237ef 100644 --- a/apiserver/plane/bgtasks/project_invitation_task.py +++ b/apiserver/plane/bgtasks/project_invitation_task.py @@ -6,8 +6,6 @@ from celery import shared_task # Django imports # Third party imports -from celery import shared_task -from django.conf import settings from django.core.mail import EmailMultiAlternatives, get_connection from django.template.loader import render_to_string from django.utils.html import strip_tags