Compare commits

...

3 Commits

Author SHA1 Message Date
NarayanBavisetti aa0aeefbbe fix: draft issue title fixes 2024-01-03 12:29:53 +05:30
NarayanBavisetti 63de81c2be Merge branch 'develop' of github.com:makeplane/plane into fix/issue-state-change 2024-01-03 11:59:50 +05:30
NarayanBavisetti aca1546f69 fix: untitled draft issue 2024-01-02 19:11:25 +05:30
2 changed files with 13 additions and 0 deletions
+6
View File
@@ -98,6 +98,12 @@ class IssueCreateSerializer(BaseSerializer):
"updated_at",
]
def to_internal_value(self, data):
issue_type = self.context.get("issue_type") if self.context is not None else None
if data and issue_type == "draft-issue" and not data.get('name'):
data['name'] = 'UNTITLED ISSUE'
return super().to_internal_value(data)
def to_representation(self, instance):
data = super().to_representation(instance)
data['assignees'] = [str(assignee.id) for assignee in instance.assignees.all()]
+7
View File
@@ -1428,6 +1428,12 @@ class IssueRelationViewSet(BaseViewSet):
issues = request.data.get("issues", [])
project = Project.objects.get(pk=project_id)
# If the current issue is duplicate of another issue then the current issue's state will be marked as duplicate
if relation_type == "duplicate":
issue = Issue.objects.get(pk=issue_id)
issue.state = State.objects.get(group="cancelled", workspace__slug=slug, project_id=project_id)
issue.save(update_fields=["state"])
issue_relation = IssueRelation.objects.bulk_create(
[
IssueRelation(
@@ -1624,6 +1630,7 @@ class IssueDraftViewSet(BaseViewSet):
serializer = IssueCreateSerializer(
data=request.data,
context={
"issue_type": "draft-issue",
"project_id": project_id,
"workspace_id": project.workspace_id,
"default_assignee_id": project.default_assignee_id,