chore(api): correct pylint errors

ref: #765
This commit is contained in:
2025-05-19 20:32:43 +09:30
parent e7242cf095
commit c6976d88fd
8 changed files with 3 additions and 16 deletions

View File

@ -105,7 +105,6 @@ class Entity(
):
return related_object.name
break
return ''

View File

@ -255,7 +255,6 @@ class AssetBase(
):
return related_object.name
break
return ''

View File

@ -1529,12 +1529,6 @@ class RelatedTickets(TenancyObject):
return FeatureNotUsed
def __str__(self):
# return '#' + str( self.id )
return '#'
@property
def parent_object(self):

View File

@ -780,7 +780,6 @@ class TicketBase(
):
return related_object.name
break
return ''

View File

@ -335,7 +335,6 @@ class TicketCommentBase(
):
return related_object.name
break
return ''

View File

@ -232,11 +232,10 @@ class TicketModelSerializer(
if self.instance.project is None:
raise centurion_exception.ValidationError(
details = 'Milestones require a project',
detail = 'Milestones require a project',
code = 'milestone_requires_project',
)
return False
if self.instance.project.id == self.instance.milestone.project.id:

View File

@ -448,5 +448,3 @@ def process_inventory(self, data, organization: int):
logger.critical('Exception')
raise Exception(e)
return str(f'Exception Occured: {e}')

View File

@ -1,5 +1,6 @@
from drf_spectacular.utils import extend_schema, extend_schema_view, OpenApiResponse
from access.models.tenant import Tenant
from api.viewsets.common import ModelViewSet
# This import only exists so that the migrations can be created
@ -9,7 +10,6 @@ from project_management.serializers.project import ( # pylint: disable=W0611:
ProjectImportSerializer,
ProjectModelSerializer,
ProjectViewSerializer,
Organization,
)
@ -86,7 +86,7 @@ class ViewSet( ModelViewSet ):
organization = int(self.request.data['organization'])
organization = Organization.objects.get( pk = organization )
organization = Tenant.objects.get( pk = organization )
elif self.queryset: