π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
[WEB-3249] chore: delete the user recent visits (#6496)
Bavisetti Narayan51b52a7fc3c3
diff --git a/apiserver/plane/app/views/cycle/base.py b/apiserver/plane/app/views/cycle/base.pyindex 3b2985f18c..c6682c15c3 100644--- a/apiserver/plane/app/views/cycle/base.py+++ b/apiserver/plane/app/views/cycle/base.py@@ -47,6 +47,7 @@ from plane.db.models import (User,Project,ProjectMember,+ UserRecentVisit,)from plane.utils.analytics_plot import burndown_plotfrom plane.bgtasks.recent_visited_task import recent_visited_task@@ -543,6 +544,13 @@ class CycleViewSet(BaseViewSet):entity_identifier=pk,project_id=project_id,).delete()+ # Delete the cycle from recent visits+ UserRecentVisit.objects.filter(+ project_id=project_id,+ workspace__slug=slug,+ entity_identifier=pk,+ entity_name="cycle",+ ).delete(soft=False)return Response(status=status.HTTP_204_NO_CONTENT)diff --git a/apiserver/plane/app/views/issue/base.py b/apiserver/plane/app/views/issue/base.pyindex 01f4068eee..c37a3cad12 100644--- a/apiserver/plane/app/views/issue/base.py+++ b/apiserver/plane/app/views/issue/base.py@@ -44,6 +44,7 @@ from plane.db.models import (Project,ProjectMember,CycleIssue,+ UserRecentVisit,)from plane.utils.grouper import (issue_group_values,@@ -671,6 +672,13 @@ class IssueViewSet(BaseViewSet):issue = Issue.objects.get(workspace__slug=slug, project_id=project_id, pk=pk)issue.delete()+ # delete the issue from recent visits+ UserRecentVisit.objects.filter(+ project_id=project_id,+ workspace__slug=slug,+ entity_identifier=pk,+ entity_name="issue",+ ).delete(soft=False)issue_activity.delay(type="issue.activity.deleted",requested_data=json.dumps({"issue_id": str(pk)}),diff --git a/apiserver/plane/app/views/module/base.py b/apiserver/plane/app/views/module/base.pyindex 3e3a4c2db7..d9118de0a7 100644--- a/apiserver/plane/app/views/module/base.py+++ b/apiserver/plane/app/views/module/base.py@@ -54,6 +54,7 @@ from plane.db.models import (ModuleLink,ModuleUserProperties,Project,+ UserRecentVisit,)from plane.utils.analytics_plot import burndown_plotfrom plane.utils.timezone_converter import user_timezone_converter@@ -808,6 +809,13 @@ class ModuleViewSet(BaseViewSet):entity_identifier=pk,project_id=project_id,).delete()+ # delete the module from recent visits+ UserRecentVisit.objects.filter(+ project_id=project_id,+ workspace__slug=slug,+ entity_identifier=pk,+ entity_name="module",+ ).delete(soft=False)return Response(status=status.HTTP_204_NO_CONTENT)diff --git a/apiserver/plane/app/views/page/base.py b/apiserver/plane/app/views/page/base.pyindex ff6d354627..f4fdc49391 100644--- a/apiserver/plane/app/views/page/base.py+++ b/apiserver/plane/app/views/page/base.py@@ -33,6 +33,7 @@ from plane.db.models import (ProjectMember,ProjectPage,Project,+ UserRecentVisit,)from plane.utils.error_codes import ERROR_CODESfrom ..base import BaseAPIView, BaseViewSet@@ -387,6 +388,13 @@ class PageViewSet(BaseViewSet):entity_identifier=pk,entity_type="page",).delete()+ # Delete the page from recent visit+ UserRecentVisit.objects.filter(+ project_id=project_id,+ workspace__slug=slug,+ entity_identifier=pk,+ entity_name="page",+ ).delete(soft=False)return Response(status=status.HTTP_204_NO_CONTENT)diff --git a/apiserver/plane/app/views/view/base.py b/apiserver/plane/app/views/view/base.pyindex ca4048b707..c2b401abf9 100644--- a/apiserver/plane/app/views/view/base.py+++ b/apiserver/plane/app/views/view/base.py@@ -24,6 +24,7 @@ from plane.db.models import (ProjectMember,Project,CycleIssue,+ UserRecentVisit,)from plane.utils.grouper import (issue_group_values,@@ -495,6 +496,13 @@ class IssueViewViewSet(BaseViewSet):entity_identifier=pk,entity_type="view",).delete()+ # Delete the page from recent visit+ UserRecentVisit.objects.filter(+ project_id=project_id,+ workspace__slug=slug,+ entity_identifier=pk,+ entity_name="view",+ ).delete(soft=False)else:return Response({"error": "Only admin or owner can delete the view"},