summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/views.py6
-rw-r--r--ishtar_common/wizards.py14
2 files changed, 16 insertions, 4 deletions
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index c713b9972..54af31cff 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -101,7 +101,7 @@ def index(request):
logout(request)
return render(request, 'index.html', dct)
-person_search_wizard = wizards.SearchWizard.as_view(
+person_search_wizard = wizards.PersonWizard.as_view(
[('general-person_search', forms.PersonFormSelection)],
label=_(u"Person search"),
url_name='person_search',)
@@ -136,7 +136,7 @@ person_deletion_wizard = wizards.PersonDeletionWizard.as_view(
label=_(u"Person deletion"),
url_name='person_deletion',)
-organization_search_wizard = wizards.SearchWizard.as_view(
+organization_search_wizard = wizards.OrganizationSearch.as_view(
[('general-organization_search', forms.OrganizationFormSelection)],
label=_(u"Organization search"),
url_name='organization_search',)
@@ -1593,7 +1593,7 @@ get_document = get_item(models.Document, 'get_document', 'document')
display_document = display_item(models.Document)
-document_search_wizard = wizards.SearchWizard.as_view(
+document_search_wizard = wizards.DocumentSearch.as_view(
[('selec-document_search', forms.DocumentFormSelection)],
label=_(u"Document: search"),
url_name='search-document',
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py
index 9a068063b..62bafdfe4 100644
--- a/ishtar_common/wizards.py
+++ b/ishtar_common/wizards.py
@@ -1424,7 +1424,7 @@ class SearchWizard(IshtarWizard):
current_step = self.steps.current
bookmark = self.request.GET.get('bookmark', None)
default_search_vector = None
- if bookmark:
+ if bookmark and self.model:
try:
app_label = self.model.__module__.split('.')[0]
sq = models.SearchQuery.objects.get(
@@ -1444,6 +1444,18 @@ class SearchWizard(IshtarWizard):
return context
+class PersonSearch(SearchWizard):
+ model = models.Person
+
+
+class OrganizationSearch(SearchWizard):
+ model = models.Organization
+
+
+class DocumentSearch(SearchWizard):
+ model = models.Document
+
+
class DeletionWizard(Wizard):
def __init__(self, *args, **kwargs):
if (not hasattr(self, 'fields') or not self.fields) and \