From cc2a5cd313b3f946e7077b2aea81f107f9ea4bc0 Mon Sep 17 00:00:00 2001
From: Todd Dembrey <todd.dembrey@torchbox.com>
Date: Tue, 8 Jan 2019 15:08:28 +0000
Subject: [PATCH] Add the search back in

---
 .../apply/funds/templates/funds/submissions.html    |  2 +-
 opentech/apply/funds/views.py                       | 13 ++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/opentech/apply/funds/templates/funds/submissions.html b/opentech/apply/funds/templates/funds/submissions.html
index 0e8cab60a..6c9d4af28 100644
--- a/opentech/apply/funds/templates/funds/submissions.html
+++ b/opentech/apply/funds/templates/funds/submissions.html
@@ -11,6 +11,7 @@
                 <h5>Track and explore recent submissions</h5>
             </div>
         {% endblock %}
+        {% include "funds/includes/search.html" %}
     </div>
 </div>
 
@@ -23,7 +24,6 @@
 <a href="#" class="js-open-feed link link--open-feed">
     <h4 class="heading heading--no-margin heading--activity-feed">Activity Feed</h4>
 </a>
-|
 {% include "funds/includes/activity-feed.html" %}
 
 {% endblock %}
diff --git a/opentech/apply/funds/views.py b/opentech/apply/funds/views.py
index f21e1b74a..043ae8c9f 100644
--- a/opentech/apply/funds/views.py
+++ b/opentech/apply/funds/views.py
@@ -87,27 +87,26 @@ class SubmissionsByRound(BaseAdminSubmissionsTable):
 
 
 @method_decorator(staff_required, name='dispatch')
-class SubmissionSearchView(SingleTableMixin, FilterView):
+class SubmissionSearchView(BaseAdminSubmissionsTable):
     template_name = 'funds/submissions_search.html'
-    table_class = AdminSubmissionsTable
 
     filterset_class = SubmissionFilterAndSearch
 
-    def get_queryset(self):
-        return self.filterset_class._meta.model.objects.current().for_table(self.request.user)
-
     def get_context_data(self, **kwargs):
+        kwargs = super().get_context_data(**kwargs,)
+
         search_term = self.request.GET.get('query')
 
         # We have more data than just 'query'
         active_filters = len(self.filterset.data) > 1
 
-        return super().get_context_data(
+        kwargs.update(
             search_term=search_term,
             active_filters=active_filters,
-            **kwargs,
         )
 
+        return kwargs
+
 
 @method_decorator(staff_required, name='dispatch')
 class ProgressSubmissionView(DelegatedViewMixin, UpdateView):
-- 
GitLab