[WEB-4668] fix: LabelDetailAPIEndpoint from LabelListCreateAPIEndpoint (#7571)

This commit is contained in:
Nikhil 2025-08-12 14:43:14 +05:30 committed by GitHub
parent d317755ab9
commit 545507fa97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 233 additions and 3 deletions

View file

@ -947,7 +947,7 @@ class LabelListCreateAPIEndpoint(BaseAPIView):
)
class LabelDetailAPIEndpoint(BaseAPIView):
class LabelDetailAPIEndpoint(LabelListCreateAPIEndpoint):
"""Label Detail Endpoint"""
serializer_class = LabelSerializer
@ -1012,14 +1012,16 @@ class LabelDetailAPIEndpoint(BaseAPIView):
if (
str(request.data.get("external_id"))
and (label.external_id != str(request.data.get("external_id")))
and Issue.objects.filter(
and Label.objects.filter(
project_id=project_id,
workspace__slug=slug,
external_source=request.data.get(
"external_source", label.external_source
),
external_id=request.data.get("external_id"),
).exists()
)
.exclude(id=pk)
.exists()
):
return Response(
{