fix: PATCH endpoint project estimate validation (#7872)
This commit is contained in:
parent
1e1520b85f
commit
584a1aa725
1 changed files with 2 additions and 2 deletions
|
|
@ -17,7 +17,7 @@ from plane.utils.content_validator import (
|
|||
from .base import BaseSerializer
|
||||
|
||||
|
||||
class ProjectCreateSerializer(BaseSerializer):
|
||||
class ProjectCreateSerializer(BaseSerializer):
|
||||
"""
|
||||
Serializer for creating projects with workspace validation.
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ class ProjectUpdateSerializer(ProjectCreateSerializer):
|
|||
|
||||
if (
|
||||
validated_data.get("estimate", None) is not None
|
||||
and not Estimate.objects.filter(project=instance, id=validated_data.get("estimate")).exists()
|
||||
and not Estimate.objects.filter(project=instance, id=validated_data.get("estimate").id).exists()
|
||||
):
|
||||
# Check if the estimate is a estimate in the project
|
||||
raise serializers.ValidationError("Estimate should be a estimate in the project")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue