IDR / idr-gallery

https://pypi.org/project/idr-gallery/
GNU Affero General Public License v3.0
1 stars 1 forks source link

Handle mapr redirect when no results found #28

Closed will-moore closed 1 year ago

will-moore commented 1 year ago

Fixes error when you choose an "Image Attribute" from front page, enter a non-existing value into auto-complete (no results returned) and hit enter.

This tries to load e.g. https://idr.openmicroscopy.org/search/?query=mapr_gene:fakevalue which currently gives an error.

  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/idr_gallery/views.py", line 118, in find_mapr_key_value
    mapann_key = all_keys[0]

IndexError: list index out of range

With this fix, the redirect should work and provide a results page (showing no results) e.g. /search/?key=Gene+Symbol&value=fakevalue&operator=contains

will-moore commented 1 year ago

@francesw This is deployed on idr-testing now, if you want to give it a try?

will-moore commented 1 year ago

The ci failure above should be fixed in https://github.com/IDR/idr-gallery/pull/27 and should pass once that is merged.

francesw commented 1 year ago

Yes, works as expected now, thanks!

will-moore commented 1 year ago

Merged this into #27 to test together. Closing...