German-BioImaging / omero-tagsearch

Extensions to OMERO.web to enhance image/dataset/project filtering from tags.
GNU Affero General Public License v3.0
0 stars 1 forks source link

views.tag_image_search returned None #13

Closed will-moore closed 5 days ago

will-moore commented 1 month ago

Just saw this issue at https://www.openmicroscopy.org/qa2/qa/feedback/41689/

Traceback (most recent call last):

File "/opt/omero/web/venv3/lib64/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)

File "/opt/omero/web/venv3/lib64/python3.9/site-packages/django/core/handlers/base.py", line 204, in _get_response
self.check_response(response, callback)

File "/opt/omero/web/venv3/lib64/python3.9/site-packages/django/core/handlers/base.py", line 332, in check_response
raise ValueError(

ValueError: The view omero_tagsearch.views.tag_image_search didn't return an HttpResponse object. It returned None instead.

Don't know how this error was produced (or what version of the app) but just looking at the code, it looks like the only way that you could get None returned is if the request.method == "GET" wasn't True at https://github.com/German-BioImaging/omero-tagsearch/blob/7f166a972e39db9a9ce10379dbde80145b25607c/omero_tagsearch/views.py#L286

I don't know if there's anything obvious in the JavaScript code that might suggest how this was called without GET? Maybe some kind of OPTIONS request? I think it's probably save to remove the request.method == "GET" check, since it's not essential to enforce this (as it is with e.g POST).

Tom-TBT commented 1 month ago

I think it was me sending it by accident, forgot to restart omero-web after the update. But you are right that enforcing the method is not necessary