Skip to content
Snippets Groups Projects
Commit 0288e814 authored by sandeepsajan0's avatar sandeepsajan0
Browse files

Show only current activities in in-app feed

parent 4d092356
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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')
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment