Compare commits

...

2 Commits

Author SHA1 Message Date
NarayanBavisetti
08d15bae1b chore: custom message for published archived project 2024-09-11 11:49:27 +05:30
NarayanBavisetti
c671fab18a fix: issue exports for project 2024-09-11 10:38:11 +05:30
2 changed files with 23 additions and 5 deletions

View File

@@ -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)

View File

@@ -60,6 +60,7 @@ from plane.db.models import (
IssueVote,
ProjectPublicMember,
IssueAttachment,
Project,
)
from plane.bgtasks.issue_activities_task import issue_activity
from plane.utils.issue_filters import issue_filters
@@ -77,6 +78,15 @@ class ProjectIssuesPublicEndpoint(BaseAPIView):
deploy_board = DeployBoard.objects.filter(
anchor=anchor, entity_name="project"
).first()
project = Project.objects.get(pk=deploy_board.project_id)
if project.archived_at:
return Response(
{"error": "Project is archived"},
status=status.HTTP_404_NOT_FOUND,
)
if not deploy_board:
return Response(
{"error": "Project is not published"},