From 0288e814da3bf4172c6feb0dee9aa952cab3a537 Mon Sep 17 00:00:00 2001
From: sandeepsajan0 <sandeepsajan0@gmail.com>
Date: Thu, 18 Aug 2022 17:01:48 +0530
Subject: [PATCH] Show only current activities in in-app feed

---
 hypha/apply/activity/context_processors.py                      | 2 +-
 hypha/apply/activity/views.py                                   | 2 +-
 .../projects/templates/application_projects/project_detail.html | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/hypha/apply/activity/context_processors.py b/hypha/apply/activity/context_processors.py
index 975680a3c..1522f47ea 100644
--- a/hypha/apply/activity/context_processors.py
+++ b/hypha/apply/activity/context_processors.py
@@ -5,5 +5,5 @@ def notification_context(request):
     context_data = dict()
     if hasattr(request, 'user'):
         if request.user.is_authenticated and request.user.is_apply_staff:
-            context_data['latest_notifications'] = Activity.objects.latest().order_by('-timestamp')[:5]
+            context_data['latest_notifications'] = Activity.objects.filter(current=True).latest().order_by('-timestamp')[:5]
     return context_data
diff --git a/hypha/apply/activity/views.py b/hypha/apply/activity/views.py
index 0af55e2b5..1a1be200f 100644
--- a/hypha/apply/activity/views.py
+++ b/hypha/apply/activity/views.py
@@ -70,7 +70,7 @@ class NotificationsView(ListView):
 
     def get_queryset(self):
         # List only last 30 days' activities
-        queryset = Activity.objects.latest()
+        queryset = Activity.objects.filter(current=True).latest()
         self.filterset = self.filterset_class(self.request.GET, queryset=queryset)
         return self.filterset.qs.distinct().order_by('-timestamp')
 
diff --git a/hypha/apply/projects/templates/application_projects/project_detail.html b/hypha/apply/projects/templates/application_projects/project_detail.html
index a6dd508b9..84499228f 100644
--- a/hypha/apply/projects/templates/application_projects/project_detail.html
+++ b/hypha/apply/projects/templates/application_projects/project_detail.html
@@ -243,6 +243,7 @@
 
 {% block extra_js %}
     <script src="{% static 'js/apply/tabs.js' %}"></script>
+    <script src="{% static 'js/apply/edit-comment.js' %}"></script>
     <script src="{% static 'js/apply/toggle-payment-block.js' %}"></script>
     <script src="{% static 'js/apply/past-reports-pagination.js' %}"></script>
     <script src="{% static 'js/apply/report-calculator.js' %}"></script>
-- 
GitLab