From 5aad20e7eda543327a41ba04a3e97f5d1746056d Mon Sep 17 00:00:00 2001 From: pablohashescobar <118773738+pablohashescobar@users.noreply.github.com> Date: Thu, 30 Mar 2023 16:33:04 +0530 Subject: [PATCH] fix: project update for identifier (#604) --- apiserver/plane/api/serializers/project.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apiserver/plane/api/serializers/project.py b/apiserver/plane/api/serializers/project.py index de9706d72..bf06b3fa2 100644 --- a/apiserver/plane/api/serializers/project.py +++ b/apiserver/plane/api/serializers/project.py @@ -58,12 +58,15 @@ class ProjectSerializer(BaseSerializer): project_identifier = ProjectIdentifier.objects.filter( name=identifier, workspace_id=instance.workspace_id ).first() - if project_identifier is None: project = super().update(instance, validated_data) - _ = ProjectIdentifier.objects.update(name=identifier, project=project) + project_identifier = ProjectIdentifier.objects.filter( + project=project + ).first() + if project_identifier is not None: + project_identifier.name = identifier + project_identifier.save() return project - # If found check if the project_id to be updated and identifier project id is same if project_identifier.project_id == instance.id: # If same pass update