diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-10-15 20:01:12 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-10-15 20:01:12 +0200 |
commit | fde883430de039e48c06ea692e5421174bd8dea6 (patch) | |
tree | cea71e684c74065595873639c2cf36c8f74dc5e5 | |
parent | 11d517940134f0cc8b684bd44c6defebdc5e7745 (diff) | |
download | Ishtar-fde883430de039e48c06ea692e5421174bd8dea6.tar.bz2 Ishtar-fde883430de039e48c06ea692e5421174bd8dea6.zip |
Fix bookmarks fro sites, documents and context records (refs #4781)
-rw-r--r-- | archaeological_context_records/urls.py | 3 | ||||
-rw-r--r-- | ishtar_common/urls.py | 4 | ||||
-rw-r--r-- | ishtar_common/wizards.py | 6 |
3 files changed, 12 insertions, 1 deletions
diff --git a/archaeological_context_records/urls.py b/archaeological_context_records/urls.py index ec37b4a25..d5c2c7d7d 100644 --- a/archaeological_context_records/urls.py +++ b/archaeological_context_records/urls.py @@ -31,6 +31,9 @@ urlpatterns = [ url(r'record_search/(?P<step>.+)?$', check_rights(['view_contextrecord', 'view_own_contextrecord'])( views.record_search_wizard), name='record_search'), + url(r'contextrecord_search/(?P<step>.+)?$', + check_rights(['view_contextrecord', 'view_own_contextrecord'])( + views.record_search_wizard), name='contextrecord_search'), url(r'record_creation/(?P<step>.+)?$', check_rights(['add_contextrecord', 'add_own_contextrecord'])( views.record_creation_wizard), name='record_creation'), diff --git a/ishtar_common/urls.py b/ishtar_common/urls.py index 534e618f7..0efd7e8d9 100644 --- a/ishtar_common/urls.py +++ b/ishtar_common/urls.py @@ -281,6 +281,10 @@ urlpatterns += [ check_rights(['view_document', 'view_own_document'])( views.document_search_wizard), name='search-document'), + url(r'document/search/(?P<step>.+)?$', + check_rights(['view_document', 'view_own_document'])( + views.document_search_wizard), + name='document_search'), url(r'document/create/$', check_rights(['add_document', 'add_own_document'])( views.DocumentCreateView.as_view()), diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 1ad394f25..30aa014c4 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -1494,12 +1494,16 @@ class SearchWizard(IshtarWizard): bookmark = self.request.GET.get('bookmark', None) default_search_vector = None if bookmark and self.model: + slug = self.model.SLUG + if slug == "site": + slug = "archaeologicalsite" + app_label = self.model.__module__.split('.')[0] try: app_label = self.model.__module__.split('.')[0] sq = models.SearchQuery.objects.get( pk=bookmark, content_type__app_label=app_label, - content_type__model=self.model.SLUG, + content_type__model=slug, profile__person__ishtaruser__user_ptr=self.request.user ) default_search_vector = sq.query.replace('"', "''") |