Skip to content

Commit

Permalink
Handle redirect for non-mapr queries on studies
Browse files Browse the repository at this point in the history
  • Loading branch information
will-moore committed Dec 7, 2022
1 parent 8ce5b62 commit 9743a5d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions idr_gallery/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,16 @@ def index(request, super_category=None, conn=None, **kwargs):
key=keyval[0],
value=keyval[1],
operator="equals")
# otherwise show filter studies page
template = "idr_gallery/mapr_search.html"
# handle e.g. ?query=Publication%20Authors:smith
# ?key=Publication+Authors&value=Smith&operator=contains&resource=container
keyval = query.split(":", 1)
# search for studies ("containers") and use "contains"
# to match previous behaviour
return redirect_with_params('idr_gallery_search',
key=keyval[0],
value=keyval[1],
resource="container",
operator="contains")
else:
template = "idr_gallery/search.html"
context = {'template': template}
Expand Down

0 comments on commit 9743a5d

Please sign in to comment.