From c671fab18a38b8c17ea4fddd7786ce04c885981a Mon Sep 17 00:00:00 2001 From: NarayanBavisetti Date: Wed, 11 Sep 2024 10:38:11 +0530 Subject: [PATCH 1/2] fix: issue exports for project --- apiserver/plane/bgtasks/export_task.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/apiserver/plane/bgtasks/export_task.py b/apiserver/plane/bgtasks/export_task.py index 27d6ff4769f..d718ee2c777 100644 --- a/apiserver/plane/bgtasks/export_task.py +++ b/apiserver/plane/bgtasks/export_task.py @@ -244,9 +244,14 @@ def update_json_row(rows, row): ) assignee, label = row["Assignee"], row["Labels"] - if assignee is not None and assignee not in existing_assignees: + + # if assignee is not None and assignee not in existing_assignees: + if assignee is not None and ( + existing_assignees is None or label not in existing_assignees + ): rows[matched_index]["Assignee"] += f", {assignee}" - if label is not None and label not in existing_labels: + # if label is not None and label not in existing_labels: + if label is not None and (existing_labels is None or label not in existing_labels): rows[matched_index]["Labels"] += f", {label}" else: rows.append(row) @@ -266,9 +271,12 @@ def update_table_row(rows, row): existing_assignees, existing_labels = rows[matched_index][7:9] assignee, label = row[7:9] - if assignee is not None and assignee not in existing_assignees: - rows[matched_index][7] += f", {assignee}" - if label is not None and label not in existing_labels: + + if assignee is not None and ( + existing_assignees is None or label not in existing_assignees + ): + rows[matched_index][8] += f", {assignee}" + if label is not None and (existing_labels is None or label not in existing_labels): rows[matched_index][8] += f", {label}" else: rows.append(row) From 5ae7954c8c810276c411fec2fe3168f4a5e4c935 Mon Sep 17 00:00:00 2001 From: NarayanBavisetti Date: Wed, 11 Sep 2024 10:41:28 +0530 Subject: [PATCH 2/2] chore: code cleanup --- apiserver/plane/bgtasks/export_task.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apiserver/plane/bgtasks/export_task.py b/apiserver/plane/bgtasks/export_task.py index d718ee2c777..e671608d9df 100644 --- a/apiserver/plane/bgtasks/export_task.py +++ b/apiserver/plane/bgtasks/export_task.py @@ -244,14 +244,13 @@ def update_json_row(rows, row): ) assignee, label = row["Assignee"], row["Labels"] - - # if assignee is not None and assignee not in existing_assignees: if assignee is not None and ( existing_assignees is None or label not in existing_assignees ): rows[matched_index]["Assignee"] += f", {assignee}" - # if label is not None and label not in existing_labels: - if label is not None and (existing_labels is None or label not in existing_labels): + if label is not None and ( + existing_labels is None or label not in existing_labels + ): rows[matched_index]["Labels"] += f", {label}" else: rows.append(row) @@ -271,12 +270,13 @@ def update_table_row(rows, row): existing_assignees, existing_labels = rows[matched_index][7:9] assignee, label = row[7:9] - if assignee is not None and ( existing_assignees is None or label not in existing_assignees ): rows[matched_index][8] += f", {assignee}" - if label is not None and (existing_labels is None or label not in existing_labels): + if label is not None and ( + existing_labels is None or label not in existing_labels + ): rows[matched_index][8] += f", {label}" else: rows.append(row)