diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-22 16:59:00 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-22 16:59:00 +0200 |
commit | 7870e9eb392a0ced9fa722e8a4c1e048075c04ff (patch) | |
tree | 608a87900972a8d227dabd864a669bd8bc1c633b /ishtar_common | |
parent | ee52553baad7d5b28a44e55a79104bbcf71e5ed1 (diff) | |
download | Ishtar-7870e9eb392a0ced9fa722e8a4c1e048075c04ff.tar.bz2 Ishtar-7870e9eb392a0ced9fa722e8a4c1e048075c04ff.zip |
Bookmark: manage missing bookmark configuration
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/views.py | 6 | ||||
-rw-r--r-- | ishtar_common/wizards.py | 14 |
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 \ |