From f09c9b67f6b1793f9ccab4cba5ee8ac063aeacb1 Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Tue, 7 Feb 2023 13:25:06 +0530 Subject: [PATCH 1/4] fix: module issue assignment --- apiserver/plane/api/views/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apiserver/plane/api/views/module.py b/apiserver/plane/api/views/module.py index 73014fefd..2772d0d6a 100644 --- a/apiserver/plane/api/views/module.py +++ b/apiserver/plane/api/views/module.py @@ -179,7 +179,7 @@ class ModuleIssueViewSet(BaseViewSet): record_to_create.append( ModuleIssue( module=module, - issue=issue, + issue_id=issue, project_id=project_id, workspace=module.workspace, created_by=request.user, From 8801a291af6833e3224fe9574564009df15654f5 Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Tue, 7 Feb 2023 14:05:09 +0530 Subject: [PATCH 2/4] fix: module issue updation and activity logging --- apiserver/plane/api/views/module.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apiserver/plane/api/views/module.py b/apiserver/plane/api/views/module.py index 2772d0d6a..80504d180 100644 --- a/apiserver/plane/api/views/module.py +++ b/apiserver/plane/api/views/module.py @@ -165,10 +165,10 @@ class ModuleIssueViewSet(BaseViewSet): ] if len(module_issue): - if module_issue[0].cycle_id != module_id: + if module_issue[0].module_id != module_id: update_module_issue_activity.append( { - "old_module_id": str(module_issue[0].cycle_id), + "old_module_id": str(module_issue[0].module_id), "new_module_id": str(module_id), "issue_id": str(module_issue[0].issue_id), } @@ -179,7 +179,7 @@ class ModuleIssueViewSet(BaseViewSet): record_to_create.append( ModuleIssue( module=module, - issue_id=issue, + issue=issue, project_id=project_id, workspace=module.workspace, created_by=request.user, @@ -203,14 +203,14 @@ class ModuleIssueViewSet(BaseViewSet): issue_activity.delay( { "type": "issue.activity", - "requested_data": json.dumps({"cycles_list": issues}), + "requested_data": json.dumps({"modules_list": issues}), "actor_id": str(self.request.user.id), "issue_id": str(self.kwargs.get("pk", None)), "project_id": str(self.kwargs.get("project_id", None)), "current_instance": json.dumps( { - "updated_cycle_issues": update_module_issue_activity, - "created_cycle_issues": serializers.serialize( + "updated_module_issues": update_module_issue_activity, + "created_module_issues": serializers.serialize( "json", record_to_create ), } From 51b3815b7284ab6304ed6ef66de7a5743652ad09 Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Tue, 7 Feb 2023 14:10:06 +0530 Subject: [PATCH 3/4] fix: typo while creating module issues --- apiserver/plane/api/views/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apiserver/plane/api/views/module.py b/apiserver/plane/api/views/module.py index 80504d180..05a1d3e5e 100644 --- a/apiserver/plane/api/views/module.py +++ b/apiserver/plane/api/views/module.py @@ -179,7 +179,7 @@ class ModuleIssueViewSet(BaseViewSet): record_to_create.append( ModuleIssue( module=module, - issue=issue, + issue_id=issue, project_id=project_id, workspace=module.workspace, created_by=request.user, From 1d44071a772293ac25e0c499c71c594c8f560ec2 Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Tue, 7 Feb 2023 14:26:28 +0530 Subject: [PATCH 4/4] fix: string comparison for update operation --- apiserver/plane/api/views/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apiserver/plane/api/views/module.py b/apiserver/plane/api/views/module.py index 05a1d3e5e..a1cda9834 100644 --- a/apiserver/plane/api/views/module.py +++ b/apiserver/plane/api/views/module.py @@ -161,7 +161,7 @@ class ModuleIssueViewSet(BaseViewSet): module_issue = [ module_issue for module_issue in module_issues - if module_issue.issue_id in issues + if str(module_issue.issue_id) in issues ] if len(module_issue):